Exemplo n.º 1
0
 /**
  * Get the methods that are available for mixin based
  * 
  * This functions allows for conditional mixing of the behavior. Only if 
  * the mixer has a 'path' property the behavior will allow to be 
  * mixed in.
  * 
  * @param object The mixer requesting the mixable methods. 
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = array();
     if (isset($mixer->path)) {
         $methods = parent::getMixableMethods($mixer);
     }
     return $methods;
 }
Exemplo n.º 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 object The mixer requesting the mixable methods. 
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = array();
     if (isset($mixer->modified_by) || isset($mixer->modified_on)) {
         $methods = parent::getMixableMethods($mixer);
     }
     return $methods;
 }
Exemplo n.º 3
0
 /**
  * Get the methods that are available for mixin based
  * 
  * This function conditionaly mixes of the behavior. Only if the mixer 
  * has a 'uuid' property the behavior will be mixed in.
  * 
  * @param object The mixer requesting the mixable methods. 
  * @return array An array of methods
  */
 public function getMixableMethods(KObject $mixer = null)
 {
     $methods = array();
     if (isset($mixer->uuid)) {
         $methods = parent::getMixableMethods($mixer);
     }
     //Lazy load the random number
     $this->_urand = @fopen('/dev/urandom', 'rb');
     return $methods;
 }
 /**
  * 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())
 {
     if ($this->_column !== 'parameters') {
         $exclude = array_merge($exclude, array('getParameters'));
         $methods = parent::getMixableMethods($exclude);
         //Add dynamic methods based on the column name
         $methods['get' . ucfirst($this->_column)] = $this;
         $methods['setProperty' . ucfirst($this->_column)] = $this;
     } else {
         $methods = parent::getMixableMethods();
     }
     return $methods;
 }