本文整理匯總了PHP中eZContentClassAttribute::nameFromSerializedString方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentClassAttribute::nameFromSerializedString方法的具體用法?PHP eZContentClassAttribute::nameFromSerializedString怎麽用?PHP eZContentClassAttribute::nameFromSerializedString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentClassAttribute
的用法示例。
在下文中一共展示了eZContentClassAttribute::nameFromSerializedString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetchAttributes
static function fetchAttributes( $version, $contentObjectID, $language = false, $asObject = true )
{
$db = eZDB::instance();
$language = $db->escapeString( $language );
$contentObjectID = (int) $contentObjectID;
$version =(int) $version;
$query = "SELECT ezcontentobject_attribute.*, ezcontentclass_attribute.identifier as classattribute_identifier,
ezcontentclass_attribute.can_translate, ezcontentclass_attribute.serialized_name_list as attribute_serialized_name_list
FROM ezcontentobject_attribute, ezcontentclass_attribute, ezcontentobject_version
WHERE
ezcontentclass_attribute.version = '0' AND
ezcontentclass_attribute.id = ezcontentobject_attribute.contentclassattribute_id AND
ezcontentobject_attribute.version = '$version' AND
ezcontentobject_attribute.contentobject_id = '$contentObjectID' AND
ezcontentobject_version.contentobject_id = '$contentObjectID' AND
ezcontentobject_version.version = '$version' AND ".
( ( $language )? "ezcontentobject_attribute.language_code = '$language'": eZContentLanguage::sqlFilter( 'ezcontentobject_attribute', 'ezcontentobject_version' ) ).
" ORDER by
ezcontentclass_attribute.placement ASC";
$attributeArray = $db->arrayQuery( $query );
$returnAttributeArray = array();
foreach ( $attributeArray as $attribute )
{
$attr = new eZContentObjectAttribute( $attribute );
$attr->setContentClassAttributeIdentifier( $attribute['classattribute_identifier'] );
$dataType = $attr->dataType();
if ( is_object( $dataType ) &&
$dataType->Attributes["properties"]["translation_allowed"] &&
$attribute['can_translate'] )
$attr->setContentClassAttributeCanTranslate( 1 );
else
$attr->setContentClassAttributeCanTranslate( 0 );
$attr->setContentClassAttributeName( eZContentClassAttribute::nameFromSerializedString( $attribute['attribute_serialized_name_list'] ) );
$returnAttributeArray[] = $attr;
}
return $returnAttributeArray;
}