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


PHP BaseObject::__call方法代碼示例

本文整理匯總了PHP中BaseObject::__call方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseObject::__call方法的具體用法?PHP BaseObject::__call怎麽用?PHP BaseObject::__call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseObject的用法示例。


在下文中一共展示了BaseObject::__call方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __call

 /**
  * Called when a magic method that is normally only accessible from a specially
  * constructed join query is called, e.g. $course->getSchoolBId()
  */
 public function __call($name, $args)
 {
     // query results are also Spiderable objects
     if ($this->isQueryResult) {
         return parent::__call($name, $args);
     } else {
         try {
             return parent::__call($name, $args);
         } catch (PropelException $e) {
             $includeMetadata = $name == 'Name' || $name == 'Professor' || $name == 'NbCampuses' || $name == 'IsCurrentTerm';
             return call_user_func_array(array($this->getJoinedQueryResult($includeMetadata), $name), $args);
         }
     }
 }
開發者ID:therealchiko,項目名稱:getchabooks,代碼行數:18,代碼來源:Spiderable.php

示例2: __call

 /**
  * Catches calls to virtual methods
  */
 public function __call($name, $params)
 {
     // symfony_behaviors behavior
     if ($callable = sfMixer::getCallable('BaseCountry:' . $name)) {
         array_unshift($params, $this);
         return call_user_func_array($callable, $params);
     }
     return parent::__call($name, $params);
 }
開發者ID:homer6,項目名稱:blank_altumo,代碼行數:12,代碼來源:BaseCountry.php

示例3: __call

 /**
  * Catches calls to virtual methods
  */
 public function __call($name, $params)
 {
     if (preg_match('/get(\\w+)/', $name, $matches)) {
         $virtualColumn = $matches[1];
         if ($this->hasVirtualColumn($virtualColumn)) {
             return $this->getVirtualColumn($virtualColumn);
         }
         // no lcfirst in php<5.3...
         $virtualColumn[0] = strtolower($virtualColumn[0]);
         if ($this->hasVirtualColumn($virtualColumn)) {
             return $this->getVirtualColumn($virtualColumn);
         }
     }
     return parent::__call($name, $params);
 }
開發者ID:raulito1500,項目名稱:mdokeos,代碼行數:18,代碼來源:BaseOpenidAssociation.php


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