本文整理汇总了PHP中eZContentObject::hasAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObject::hasAttribute方法的具体用法?PHP eZContentObject::hasAttribute怎么用?PHP eZContentObject::hasAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::hasAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
/**
* Returns the value of the property $name.
*
* @throws ezcBasePropertyNotFoundException if the property does not exist.
* @param string $name
* @ignore
*/
public function __get( $name )
{
switch ( $name )
{
case 'dataMap':
{
if ( isset( $this->object ) )
return $this->object->dataMap();
else
return array();
} break;
default:
{
if ( isset( $this->dataMap[$name] ) )
{
return $this->dataMap[$name]->content();
}
if ( !$this->object instanceof eZContentObject )
throw new ezcBaseInvalidParentClassException( 'eZContentObject', $this->object );
if ( $this->object->hasAttribute( $name ) )
return $this->object->attribute( $name );
throw new ezcBasePropertyNotFoundException( '->object->attribute( ' . $name . ' )' );
}
}
}
示例2: hasAttribute
function hasAttribute($attr)
{
return in_array($attr, $this->LocalAttributeNameList) || eZContentObject::hasAttribute($attr);
}
示例3: __isset
/**
* Check if given attribute exists.
* All "classic" attributes can be used (See {@link eZContentObject::definition()}).
* @param $name
* @return bool
*/
public function __isset($name)
{
return $this->contentObject->hasAttribute($name);
}