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