\CategoryBehavior

Category Behavior

該当ブロックのカテゴリーを登録します。

サンプルコード

public $actsAs = array(
    'Categories.Category'
)

Summary

Methods
Properties
Constants
afterValidate()
beforeSave()
No public properties found
No constants found
_deleteCategories()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

afterValidate()

afterValidate(\Model  $model) : mixed

afterValidate is called just after model data was validated, you can use this callback to perform any data cleanup or preparation if needed

Parameters

\Model $model

Model using this behavior

Returns

mixed —

False will stop this event from being passed to other behaviors

beforeSave()

beforeSave(\Model  $model, array  $options = array()) : mixed

beforeSave is called before a model is saved. Returning false from a beforeSave callback will abort the save operation.

Parameters

\Model $model

Model using this behavior

array $options

Options passed from Model::save().

Throws

\InternalErrorException

Returns

mixed —

False if the operation should abort. Any other result will continue.

_deleteCategories()

_deleteCategories(\Model  $model) : boolean

不要なカテゴリを削除する

Parameters

\Model $model

Model using this behavior

Throws

\InternalErrorException

Returns

boolean