Acl\Model\Table\ArosTable::initialize PHP Method

initialize() public method

{@inheritDoc}
public initialize ( array $config ) : void
$config array Config
return void
    public function initialize(array $config)
    {
        parent::initialize($config);
        $this->alias('Aros');
        $this->table('aros');
        $this->addBehavior('Tree', ['type' => 'nested']);
        $this->belongsToMany('Acos', ['through' => App::className('Acl.PermissionsTable', 'Model/Table'), 'className' => App::className('Acl.AcosTable', 'Model/Table')]);
        $this->hasMany('AroChildren', ['className' => App::className('Acl.ArosTable', 'Model/Table'), 'foreignKey' => 'parent_id']);
        $this->entityClass(App::className('Acl.Aro', 'Model/Entity'));
    }

Usage Example

Example #1
0
 /**
  * initialize
  *
  * @param array $config Configuration array
  * @return void
  */
 public function initialize(array $config)
 {
     parent::initialize($config);
     $this->alias('DbAroTest');
     $this->associations()->removeAll();
     $this->belongsToMany('DbAcoTest', ['through' => __NAMESPACE__ . '\\DbPermissionTest', 'className' => __NAMESPACE__ . '\\DbAcoTest', 'targetForeignKey' => 'id', 'foreignKey' => 'aco_id']);
 }
All Usage Examples Of Acl\Model\Table\ArosTable::initialize
ArosTable