saveStrategy() public method

Sets the strategy that should be used for saving. If called with no arguments, it will return the currently configured strategy
public saveStrategy ( string | null $strategy = null ) : string
$strategy string | null the strategy name to be used
return string the strategy to be used for saving
示例#1
0
 /**
  * Tests that it is possible to pass the saveAssociated strategy in the constructor
  *
  * @return void
  */
 public function testSaveStrategyInOptions()
 {
     $assoc = new BelongsToMany('Test', ['saveStrategy' => BelongsToMany::SAVE_APPEND]);
     $this->assertEquals(BelongsToMany::SAVE_APPEND, $assoc->saveStrategy());
 }