/** * Mixin Notifier * * This function is called when the mixin is being mixed. It will get the mixer passed in. * * @param ObjectMixable $mixer The mixer object * @return void */ public function onMixin(ObjectMixable $mixer) { parent::onMixin($mixer); //Mixin the permission $permission = clone $mixer->getIdentifier(); $permission->path = array('dispatcher', 'permission'); if ($permission !== $this->getPermission()) { $this->setPermission($mixer->mixin($permission)); } }
/** * Mixin Notifier * * This function is called when the mixin is being mixed. It will get the mixer passed in. * * @param ObjectMixable $mixer The mixer object * @return void */ public function onMixin(ObjectMixable $mixer) { parent::onMixin($mixer); //Create and mixin the permission if it's doesn't exist yet if (!$this->_permission instanceof ControllerPermissionInterface) { $permission = $this->_permission; if (!$permission || is_string($permission) && strpos($permission, '.') === false) { $identifier = $mixer->getIdentifier()->toArray(); $identifier['path'] = array('controller', 'permission'); if ($permission) { $identifier['name'] = $permission; } $permission = $this->getIdentifier($identifier); } if (!$permission instanceof ObjectIdentifierInterface) { $permission = $this->getIdentifier($permission); } $this->_permission = $mixer->mixin($permission); } }