예제 #1
0
 /**
  * Get the methods that are available for mixin based
  *
  * This functions conditionaly mixes the behavior. Only if the mixer
  * has a 'ordering' property the behavior will be mixed in.
  *
  * @param ObjectMixable $mixer The mixer requesting the mixable methods.
  * @return array An array of methods
  */
 public function getMixableMethods(ObjectMixable $mixer = null)
 {
     $methods = array();
     if ($mixer instanceof DatabaseRowInterface && $mixer->has('ordering')) {
         $methods = parent::getMixableMethods($mixer);
     }
     return $methods;
 }
예제 #2
0
 /**
  * Get the methods that are available for mixin based
  *
  * This function conditionaly mixes the behavior. Only if the mixer
  * has a 'modified_by' or 'modified_by' property the behavior will
  * be mixed in.
  *
  * @param ObjectMixable $mixer The mixer requesting the mixable methods.
  * @return array An array of methods
  */
 public function getMixableMethods(ObjectMixable $mixer = null)
 {
     $methods = array();
     if ($mixer instanceof DatabaseRowInterface && ($mixer->has('modified_by') || $mixer->has('modified_on'))) {
         $methods = parent::getMixableMethods($mixer);
     }
     return $methods;
 }
예제 #3
0
 /**
  * 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('auto_generate' => true));
     parent::_initialize($config);
 }
예제 #4
0
 /**
  * Get the methods that are available for mixin based
  *
  * @param  array $exclude   A list of methods to exclude
  * @return array  An array of methods
  */
 public function getMixableMethods($exclude = array())
 {
     $exclude = array_merge($exclude, array('getNodes'));
     $methods = parent::getMixableMethods($exclude);
     return $methods;
 }
예제 #5
0
 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   ObjectConfig $config Configuration options
  * @return  void
  */
 protected function _initialize(ObjectConfig $config)
 {
     $config->append(array('columns' => 'title', 'separator' => '-', 'updatable' => true, 'length' => null, 'unique' => null));
     parent::_initialize($config);
 }
예제 #6
0
 /**
  * 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('priority' => self::PRIORITY_LOW));
     parent::_initialize($config);
 }
예제 #7
0
 /**
  * Intercept parameter getter and setter calls
  *
  * @param  string   $method     The function name
  * @param  array    $arguments  The function arguments
  * @throws \BadMethodCallException   If method could not be found
  * @return mixed The result of the function
  */
 public function __call($method, $arguments)
 {
     if ($this->_column !== 'parameters') {
         //Call getParameters()
         if ($method == 'get' . ucfirst($this->_column)) {
             return $this->getParameters();
         }
         //Call setPropertyParameters()
         if ($method == 'setProperty' . ucfirst($this->_column)) {
             return $this->setPropertyParameters($arguments[0]);
         }
     }
     return parent::__call($method, $arguments);
 }
예제 #8
0
 /**
  * Initializes the options for the object
  *
  * Called from {@link __construct()} as a first step of object instantiation.
  *
  * @param   ObjectConfig $config Configuration options
  * @return void
  */
 protected function _initialize(ObjectConfig $config)
 {
     $config->append(array('priority' => self::PRIORITY_HIGH, 'lifetime' => $this->getObject('user')->getSession()->getLifetime()));
     $this->_lifetime = $config->lifetime;
     parent::_initialize($config);
 }