本文整理汇总了PHP中lithium\core\Object::respondsTo方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::respondsTo方法的具体用法?PHP Object::respondsTo怎么用?PHP Object::respondsTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lithium\core\Object
的用法示例。
在下文中一共展示了Object::respondsTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: respondsTo
/**
* Determines if a given method can be called.
*
* @param string $method Name of the method.
* @param boolean $internal Provide `true` to perform check from inside the
* class/object. When `false` checks also for public visibility;
* defaults to `false`.
* @return boolean Returns `true` if the method can be called, `false` otherwise.
*/
public function respondsTo($method, $internal = false)
{
$methodExists = in_array($method, array('gt', 'gte', 'lt', 'lte', 'eq'), true);
return $methodExists || parent::respondsTo($method, $internal);
}
示例2: respondsTo
/**
* Determines if a given method can be called.
*
* @param string $method Name of the method.
* @param boolean $internal Provide `true` to perform check from inside the
* class/object. When `false` checks also for public visibility;
* defaults to `false`.
* @return boolean Returns `true` if the method can be called, `false` otherwise.
*/
public function respondsTo($method, $internal = false)
{
return isset($this->_config[$method]) || parent::respondsTo($method, $internal);
}
示例3: respondsTo
/**
* 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 function respondsTo($method, $internal = false)
{
$class = $this->_model;
$modelRespondsTo = false;
$parentRespondsTo = parent::respondsTo($method, $internal);
$staticRespondsTo = $class::respondsTo($method, $internal);
if (method_exists($class, '_object')) {
$model = $class::invokeMethod('_object');
$modelRespondsTo = $model->respondsTo($method);
} else {
$modelRespondsTo = Inspector::isCallable($class, $method, $internal);
}
return $parentRespondsTo || $staticRespondsTo || $modelRespondsTo;
}
示例4: respondsTo
/**
* 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 function respondsTo($method, $internal = 0)
{
$parentRespondsTo = parent::respondsTo($method, $internal);
return $parentRespondsTo || is_callable(array($this->connection, $method));
}
示例5: respondsTo
/**
* 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 function respondsTo($method, $internal = false)
{
$magicMethod = count($this->_data) > 0 && $this->_data[0]->respondsTo($method, $internal);
return $magicMethod || parent::respondsTo($method, $internal);
}
示例6: respondsTo
/**
* Determines if a given method can be called.
*
* @param string $method Name of the method.
* @param boolean $internal Provide `true` to perform check from inside the
* class/object. When `false` checks also for public visibility;
* defaults to `false`.
* @return boolean Returns `true` if the method can be called, `false` otherwise.
*/
public function respondsTo($method, $internal = false)
{
if (method_exists($class = $this->_model, '_object')) {
$result = $class::invokeMethod('_object')->respondsTo($method);
} else {
$result = Inspector::isCallable($class, $method, $internal);
}
$result = $result || parent::respondsTo($method, $internal);
$result = $result || $class::respondsTo($method, $internal);
return $result;
}