Class SaveOptionsBuilder
OOPスタイルの保存オプションビルダー。
OOP style Save Option Builder.
これにより、エンティティをOOPスタイルで保存するオプションを構築でき、構築時にオプションを検証することで間違いを回避できます。
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.
Properties summary
Method Summary
-
__construct() public
コンストラクタ。
Constructor.
-
_associated() protected
関連付けが再帰的に存在することを確認します。
Checks that the associations exists recursively.
-
_checkAssociation() protected
関連付けが存在するかどうかを確認します。
Checks if an association exists.
-
_normalizeAssociations() protected
他のルーチンで解析できるように、ドット表記がネストされた配列に変換される元の渡された関連付けリストから配列を返します
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
-
associated() public
関連するオプションを設定します。
Set associated options.
-
atomic() public
アトミックオプションを設定します。
Sets the atomic option.
-
checkExisting() public
既存のチェックオプションを設定します。
Set check existing option.
-
checkRules() public
ルールをチェックするオプション。
Option to check the rules.
-
guard() public
ガードオプションを設定します。
Set the guard option.
-
parseArrayOptions() public
オプション配列を受け取り、オプションオブジェクトにデータを入力します。
Takes an options array and populates the option object with the data.
-
set() public
カスタムオプションの設定。
Setting custom options.
-
toArray() public
-
validate() public
使用する検証ルールセットを設定します。
Set the validation rule set to use.
Method Detail
__construct() public ¶
__construct(\Cake\ORM\Table $table, array $options)
コンストラクタ。
Constructor.
Parameters
-
\Cake\ORM\Table
$table -
テーブルインスタンス。
A table instance.
-
array
$options optional -
インスタンス化時に解析するオプション。
Options to parse when instantiating.
_associated() protected ¶
_associated(\Cake\ORM\Table $table, array $associations)
関連付けが再帰的に存在することを確認します。
Checks that the associations exists recursively.
Parameters
-
\Cake\ORM\Table
$table -
テーブルオブジェクト。
Table object.
-
array
$associations -
関連配列。
An associations array.
_checkAssociation() protected ¶
_checkAssociation(\Cake\ORM\Table $table, string $association)
関連付けが存在するかどうかを確認します。
Checks if an association exists.
Parameters
-
\Cake\ORM\Table
$table -
テーブルオブジェクト。
Table object.
-
string
$association -
協会名。
Association name.
Throws
RuntimeException
指定されたテーブルにそのような関連付けが存在しない場合。
If no such association exists for the given table.
_normalizeAssociations() protected ¶
_normalizeAssociations(mixed $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
Parameters
-
array|string
$associations -
含まれる関連付けの配列。
The array of included associations.
Returns
array
ドット表記がネストされた配列に変換された配列
An array having dot notation transformed into nested arrays
associated() public ¶
associated(mixed $associated)
関連するオプションを設定します。
Set associated options.
Parameters
-
string|array
$associated -
関連付けの文字列または配列。
String or array of associations.
Returns
$this
atomic() public ¶
atomic(bool $atomic)
アトミックオプションを設定します。
Sets the atomic option.
Parameters
-
bool
$atomic -
原子かどうか。
Atomic or not.
Returns
$this
checkExisting() public ¶
checkExisting(bool $checkExisting)
既存のチェックオプションを設定します。
Set check existing option.
Parameters
-
bool
$checkExisting -
プロパティを守るかどうか。
Guard the properties or not.
Returns
$this
checkRules() public ¶
checkRules(bool $checkRules)
ルールをチェックするオプション。
Option to check the rules.
Parameters
-
bool
$checkRules -
ルールを確認してください。
Check the rules or not.
Returns
$this
guard() public ¶
guard(bool $guard)
ガードオプションを設定します。
Set the guard option.
Parameters
-
bool
$guard -
プロパティを守るかどうか。
Guard the properties or not.
Returns
$this
parseArrayOptions() public ¶
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.
Parameters
-
array
$array -
オプション配列。
Options array.
Returns
$this
Throws
InvalidArgumentException
指定されたオプションキーが存在しない場合。
If a given option key does not exist.
set() public ¶
set(string $option, mixed $value)
カスタムオプションの設定。
Setting custom options.
Parameters
-
string
$option -
オプションキー。
Option key.
-
mixed
$value -
オプション値。
Option value.
Returns
$this
validate() public ¶
validate(string $validate)
使用する検証ルールセットを設定します。
Set the validation rule set to use.
Parameters
-
string
$validate -
使用する検証ルールセットの名前。
Name of the validation rule set to use.
Returns
$this