本文整理汇总了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);
}