本文整理汇总了PHP中eZContentObjectAttribute::serialize方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectAttribute::serialize方法的具体用法?PHP eZContentObjectAttribute::serialize怎么用?PHP eZContentObjectAttribute::serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObjectAttribute
的用法示例。
在下文中一共展示了eZContentObjectAttribute::serialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
/**
* Getter
* Returns given attribute if it exists. Will throw an exception otherwise.
* All "classic" attributes can be used (See {@link eZContentObjectAttribute::definition()}).
* You can also use "serializedXML" to get the serialized version of the attribute through the eZPackage mechanism
* @param $name
* @throws ezcBasePropertyNotFoundException
* @return mixed
*/
public function __get($name)
{
$ret = null;
switch ($name) {
// returns the serialized version of the attribute through the eZPackage mechanism
case 'serializedXML':
$ret = $this->attribute->serialize(new eZPackage());
break;
case 'identifier':
$ret = $this->identifier;
default:
if ($this->attribute->hasAttribute($name)) {
$ret = $this->attribute->attribute($name);
} else {
throw new ezcBasePropertyNotFoundException($name);
}
}
return $ret;
}