當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Object::respondsTo方法代碼示例

本文整理匯總了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);
 }
開發者ID:fedeisas,項目名稱:lithium,代碼行數:14,代碼來源:MockerChain.php

示例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);
 }
開發者ID:fedeisas,項目名稱:lithium,代碼行數:13,代碼來源:Query.php

示例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;
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:21,代碼來源:Entity.php

示例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));
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:12,代碼來源:Redis.php

示例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);
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:12,代碼來源:Collection.php

示例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;
 }
開發者ID:fedeisas,項目名稱:lithium,代碼行數:20,代碼來源:Entity.php


注:本文中的lithium\core\Object::respondsTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。