OOP style Save Option Builder.
This allows you to build options to save entities in a OOP style and helps you to avoid mistakes by validating the options as you build them.
ARRAY_AS_PROPS
, STD_PROP_LIST
__construct( Cake\ORM\Table $table , array $options [] )
Constructor.
Cake\ORM\Table
$table
$options
optional [] ArrayObject::__construct()
_associated( Cake\ORM\Table $table , array $associations )
Checks that the associations exists recursively.
Cake\ORM\Table
$table
$associations
_checkAssociation( Cake\ORM\Table $table , string $association )
Checks if an association exists.
Cake\ORM\Table
$table
$association
associated( string|array $associated )
Set associated options.
$associated
Cake\ORM\SaveOptionsBuilder
atomic( boolean $atomic )
Sets the atomic option.
$atomic
Cake\ORM\SaveOptionsBuilder
checkExisting( boolean $checkExisting )
Set check existing option.
$checkExisting
Cake\ORM\SaveOptionsBuilder
checkRules( boolean $checkRules )
Option to check the rules.
$checkRules
Cake\ORM\SaveOptionsBuilder
guard( boolean $guard )
Set the guard option.
$guard
Cake\ORM\SaveOptionsBuilder
parseArrayOptions( array $array )
Takes an options array and populates the option object with the data.
This can be used to turn an options array into the object.
$array
Cake\ORM\SaveOptionsBuilder
set( string $option , mixed $value )
Setting custom options.
$option
$value
Cake\ORM\SaveOptionsBuilder
validate( string $validate )
Set the validation rule set to use.
$validate
Cake\ORM\SaveOptionsBuilder
_normalizeAssociations( array $associations )
Returns an array out of the original passed associations list where dot notation is transformed into nested arrays so that they can be parsed by other routines
$associations
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.4/class-Cake.ORM.SaveOptionsBuilder.html