PHP 클래스 RelatedModelsListener, Platform-Crud-Plugin

상속: implements CakeEventListener
파일 보기 프로젝트 열기: nodesagency/Platform-Crud-Plugin

보호된 프로퍼티들

프로퍼티 타입 설명
$_crud CrudComponent Crud Component reference
$_subject CrudSubject Crud Event subject

공개 메소드들

메소드 설명
__construct ( CrudSubject $subject ) : void Class constructor
beforeRender ( $event ) : void Fetches related models' list and sets them to a variable for the view Lists are limited buy default to 200 items. Should you need more, attach an event listener for beforeListRelated event to modify the query
enable ( string | array $actions ) : void Enables association list fetching for specified actions.
implementedEvents ( ) : array List of events implemented by this class
map ( array | boolean $models, string $action = null ) : void Sets the list of model relationships to be fetched as lists for an action
models ( string $action = null ) : array Gets the list of associated model lists to be fetched for an action

보호된 메소드들

메소드 설명
_getModelInstance ( string $model, Model $controllerModel, Controller $controller ) : Model Returns model instance based on its name

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( CrudSubject $subject ) : void
$subject CrudSubject
리턴 void

_getModelInstance() 보호된 메소드

Returns model instance based on its name
protected _getModelInstance ( string $model, Model $controllerModel, Controller $controller ) : Model
$model string name of the model
$controllerModel Model default model instance for controller
$controller Controller instance to do a first look on it
리턴 Model

beforeRender() 공개 메소드

Fetches related models' list and sets them to a variable for the view Lists are limited buy default to 200 items. Should you need more, attach an event listener for beforeListRelated event to modify the query
public beforeRender ( $event ) : void
리턴 void

enable() 공개 메소드

Enables association list fetching for specified actions.
public enable ( string | array $actions ) : void
$actions string | array list of action names to enable
리턴 void

implementedEvents() 공개 메소드

List of events implemented by this class
public implementedEvents ( ) : array
리턴 array

map() 공개 메소드

Sets the list of model relationships to be fetched as lists for an action
public map ( array | boolean $models, string $action = null ) : void
$models array | boolean list of model association names to be fetch on $action if `true`, list of models will be constructed out of associated models of main controller's model
$action string name of the action to apply this rule to. If left null then it will use the current controller action
리턴 void

models() 공개 메소드

Gets the list of associated model lists to be fetched for an action
public models ( string $action = null ) : array
$action string name of the action
리턴 array

프로퍼티 상세

$_crud 보호되어 있는 프로퍼티

Crud Component reference
protected CrudComponent $_crud
리턴 CrudComponent

$_subject 보호되어 있는 프로퍼티

Crud Event subject
protected CrudSubject $_subject
리턴 CrudSubject