$UploadFile
$UploadFile : \UploadFile
Class AttachmentBehavior
$UploadFile : \UploadFile
$UploadFilesContent : \UploadFilesContent
afterFind(\Model $model, mixed $results, boolean $primary = false) : mixed
After find callback. Can be used to modify any results returned by find.
\Model | $model | Model using this behavior |
mixed | $results | The results of the find operation |
boolean | $primary | Whether this model is being queried directly (vs. being queried as an association) |
An array value will replace the value of $results - any other value will be ignored.
attachFile(\Model $model, array $data, string $fieldName, \File|string $file, string $keyFieldName = 'key') : void
コンテンツに、物理ファイルを添付する処理
\Model | $model | 元モデル |
array | $data | コンテンツデータ |
string | $fieldName | 添付するフィールド名 |
\File|string | $file | 添付するファイルのFileインスタンスかファイルパス |
string | $keyFieldName | コンテンツキーのフィールド名 省略可能 デフォルト key |