PHP Class Acl\Model\Behavior\AclBehavior

Enables objects to easily tie into an ACL system
Inheritance: extends Cake\ORM\Behavior
Show file Open project: cakephp/acl

Protected Properties

Property Type Description
$_table Table instance
$_typeMaps array Maps ACL type options to ACL models

Public Methods

Method Description
__construct ( Table $model, array $config = [] ) : void Sets up the configuration for the model, and loads ACL models if they haven't been already
afterDelete ( Cake\Event\Event $event, Cake\ORM\Entity $entity ) : void Destroys the ARO/ACO node bound to the deleted record
afterSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity ) : void Creates a new ARO/ACO node bound to this record
node ( string | array | Model $ref = null, string $type = null ) : Cake\ORM\Query Retrieves the Aro/Aco node for this model

Method Details

__construct() public method

Sets up the configuration for the model, and loads ACL models if they haven't been already
public __construct ( Table $model, array $config = [] ) : void
$model Cake\ORM\Table Table instance being attached
$config array Configuration
return void

afterDelete() public method

Destroys the ARO/ACO node bound to the deleted record
public afterDelete ( Cake\Event\Event $event, Cake\ORM\Entity $entity ) : void
$event Cake\Event\Event The afterDelete event that was fired
$entity Cake\ORM\Entity The entity being deleted
return void

afterSave() public method

Creates a new ARO/ACO node bound to this record
public afterSave ( Cake\Event\Event $event, Cake\ORM\Entity $entity ) : void
$event Cake\Event\Event The afterSave event that was fired
$entity Cake\ORM\Entity The entity being saved
return void

node() public method

Retrieves the Aro/Aco node for this model
public node ( string | array | Model $ref = null, string $type = null ) : Cake\ORM\Query
$ref string | array | Model Array with 'model' and 'foreign_key', model object, or string value
$type string Only needed when Acl is set up as 'both', specify 'Aro' or 'Aco' to get the correct node
return Cake\ORM\Query

Property Details

$_table protected property

Table instance
protected $_table

$_typeMaps protected property

Maps ACL type options to ACL models
protected array $_typeMaps
return array