本文整理汇总了PHP中ViewableData::__get方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewableData::__get方法的具体用法?PHP ViewableData::__get怎么用?PHP ViewableData::__get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewableData
的用法示例。
在下文中一共展示了ViewableData::__get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($property)
{
if ($this->hasMethod($method = "get{$property}")) {
return $this->{$method}();
} elseif (isset($this->data[strtolower($property)])) {
return $this->data[strtolower($property)];
} else {
return parent::__get($property);
}
}
示例2:
function __get($name)
{
if (isset(self::$registered_handlers[$name])) {
$collectionClass = self::$registered_handlers[$name];
$res = new $collectionClass();
$res->parent = $this;
$res->linkFragment = $name;
return $res;
}
return parent::__get($name);
}
示例3:
/**
* Insures that any array or object is wrapped properly
*/
function __get($field)
{
$val = $this->wrapObject(parent::__get($field));
if (isset($this->varName) && is_object($val) && $val instanceof ViewableWrapper) {
$val->setVar($this->varName . '_' . $field);
// if this variable isn't live, none of it's children should be
if (!$this->isLiveVar($field)) {
$val->setLiveVars(false);
}
}
return $val;
}
示例4: __get
/**
* Proxy the field requests to the underlying data source
*
* @param mixed $property
* @return mixed
*/
public function __get($property)
{
if ($this->dataSource && $this->dataSource->ID) {
// check for the fully realised field name
$name = strpos($property, LayerManager::FIELD_SEPARATOR) ? $property : $this->realisedName . LayerManager::FIELD_SEPARATOR . $property;
$val = $this->dataSource->__get($name);
if ($val) {
return $val;
}
// check has_one and many_many
if ($this->dataSource->hasMethod($name)) {
return $this->dataSource->{$name}();
}
// otherwise, just send the base property reference through
$val = $this->dataSource->__get($property);
if ($val) {
return $val;
}
}
return parent::__get($property);
}