本文整理匯總了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);
}
}
}
示例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);
}
示例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);
}