See also: lithium\core\Object
Example #1
0
 /**
  * Custom check to determine if our given magic methods can be responded to.
  *
  * @param  string  $method     Method name.
  * @param  bool    $internal   Interal call or not.
  * @return bool
  */
 public static function respondsTo($method, $internal = false)
 {
     return isset(static::$_tags[$method]) || parent::respondsTo($method, $internal);
 }
Example #2
0
 /**
  * Wraps `StaticObject::_filter()` to account for object instances.
  *
  * @see lithium\core\StaticObject::_filter()
  * @param string $method
  * @param array $params
  * @param mixed $callback
  * @param array $filters Defaults to empty array.
  * @return object
  */
 protected static function _filter($method, $params, $callback, $filters = array())
 {
     if (!strpos($method, '::')) {
         $method = get_called_class() . '::' . $method;
     }
     list($class, $method) = explode('::', $method, 2);
     $instance = static::_object();
     if (isset($instance->_instanceFilters[$method])) {
         $filters = array_merge($instance->_instanceFilters[$method], $filters);
     }
     return parent::_filter($method, $params, $callback, $filters);
 }
Example #3
0
 /**
  * Custom check to determine if our given magic methods can be responded to.
  *
  * @param  string  $method     Method name.
  * @param  bool    $internal   Interal call or not.
  * @return bool
  */
 public static function respondsTo($method, $internal = false)
 {
     $rule = preg_replace("/^is([A-Z][A-Za-z0-9]+)\$/", '$1', $method);
     $rule[0] = strtolower($rule[0]);
     return isset(static::$_rules[$rule]) || parent::respondsTo($method, $internal);
 }