Example #1
0
 /**
  * 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 DispatcherPermissionInterface) {
         $permission = $this->_permission;
         if (!$permission || is_string($permission) && strpos($permission, '.') === false) {
             $identifier = $mixer->getIdentifier()->toArray();
             if ($identifier['type'] == 'lib') {
                 $identifier['path'] = array('permission');
             } else {
                 $identifier['path'] = array('dispatcher', 'permission');
             }
             if ($permission) {
                 $identifier['name'] = $permission;
             }
             $permission = $this->getIdentifier($identifier);
         }
         if (!$permission instanceof ObjectIdentifierInterface) {
             $permission = $this->getIdentifier($permission);
         }
         $this->_permission = $mixer->mixin($permission);
     }
 }
 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param ObjectConfig $config 	An optional ObjectConfig object with configuration options.
  * @return 	void
  */
 protected function _initialize(ObjectConfig $config)
 {
     $config->append(array('authenticators' => array()));
     parent::_initialize($config);
 }
Example #3
0
 /**
  * Initializes the default configuration for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param  ObjectConfig $config An optional ObjectConfig object with configuration options.
  * @return void
  */
 protected function _initialize(ObjectConfig $config)
 {
     $config->append(array('default' => 100, 'max' => null));
     parent::_initialize($config);
 }