public function setSaveStrategy($strategy)
    {
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
            throw new InvalidArgumentException($msg);
        }

        $this->_saveStrategy = $strategy;

        return $this;
    }
public function setSaveStrategy($strategy)
    {
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
            throw new InvalidArgumentException($msg);
        }

        $this->_saveStrategy = $strategy;

        return $this;
    }
public function setSaveStrategy ( $ strategy ) { if ( ! in_array ( $ strategy , [ self :: SAVE_APPEND , self :: SAVE_REPLACE ] ) ) { $ msg = sprintf ( 'Invalid save strategy "%s"' , $ strategy ) ; throw new InvalidArgumentException ( $ msg ) ; } $ this -> _saveStrategy = $ strategy ; return $ this ; }
Sets the strategy that should be used for saving.

@param string $strategy the strategy name to be used
@throws \InvalidArgumentException if an invalid strategy name is passed
@return $this
Sets the strategy that should be used for saving .