Constants

PUBLIC_TYPE_PRIVATE

PUBLIC_TYPE_PRIVATE = '0' : integer

Block type

PUBLIC_TYPE_PUBLIC

PUBLIC_TYPE_PUBLIC = '1' : integer

Block type

PUBLIC_TYPE_LIMITED

PUBLIC_TYPE_LIMITED = '2' : integer

Block type

Properties

$statusesForEditor

$statusesForEditor : array

status list for editor

Type

array

$statuses

$statuses : array

status list

Type

array

Methods

setup()

setup(\Model  $model, array  $config = array()) : void

Setup this behavior with the specified configuration settings.

Parameters

\Model $model

Model using this behavior

array $config

Configuration settings for $model

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().

Returns

mixed —

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

beforeValidate()

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

beforeValidate is called before a model is validated, you can use this callback to add behavior validation rules into a models validate array. Returning false will allow you to make the validation fail.

Parameters

\Model $model

Model using this behavior

array $options

Options passed from Model::save().

Returns

mixed —

False or null will abort the operation. Any other result will continue.

getWorkflowConditions()

getWorkflowConditions(\Model  $model, array  $conditions = array()) : array

Get workflow conditions

Parameters

\Model $model

Model using this behavior

array $conditions

Model::find conditions default value

Returns

array —

Conditions data

getWorkflowContents()

getWorkflowContents(\Model  $model, string  $type, array  $query = array()) : array

Get workflow contents

Parameters

\Model $model

Model using this behavior

string $type

Type of find operation (all / first / count / neighbors / list / threaded)

array $query

Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks)

Returns

array —

Conditions data

canReadWorkflowContent()

canReadWorkflowContent(\Model  $model) : boolean

コンテンツの閲覧権限があるかどうかのチェック - 閲覧権限あり(content_readable)

Parameters

\Model $model

Model using this behavior

Returns

boolean —

true:閲覧可、false:閲覧不可

canCreateWorkflowContent()

canCreateWorkflowContent(\Model  $model) : boolean

コンテンツの作成権限があるかどうかのチェック - 作成権限あり(content_creatable)

Parameters

\Model $model

Model using this behavior

Returns

boolean —

true:作成可、false:作成不可

canEditWorkflowContent()

canEditWorkflowContent(\Model  $model, array  $data) : boolean

コンテンツの編集権限があるかどうかのチェック - 編集権限あり(content_editable) - 自分自身のコンテンツ

Parameters

\Model $model

Model using this behavior

array $data

コンテンツデータ

Returns

boolean —

true:編集可、false:編集不可

canDeleteWorkflowContent()

canDeleteWorkflowContent(\Model  $model, array  $data) : boolean

コンテンツの公開権限があるかどうかのチェック - 公開権限あり(content_publishable) and 編集権限あり(content_editable) - 自分自身のコンテンツ+一度も公開されていない

Parameters

\Model $model

Model using this behavior

array $data

コンテンツデータ

Returns

boolean —

true:削除可、false:削除不可

_getPublicTypeConditions()

_getPublicTypeConditions(\Model  $model) : array

時限公開のconditionsを返す

Parameters

\Model $model

対象モデル

Returns

array

__hasSaveField()

__hasSaveField(\Model  $model, mixed  $needle) : boolean

Checks wether model has the required fields

Parameters

\Model $model

instance of model

mixed $needle

The searched value.

Returns

boolean —

True if $model has the required fields