本文整理匯總了PHP中eZContentObject::setClassName方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObject::setClassName方法的具體用法?PHP eZContentObject::setClassName怎麽用?PHP eZContentObject::setClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::setClassName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeObjectsArray
static function makeObjectsArray( $array , $with_contentobject = true )
{
$retNodes = array();
if ( !is_array( $array ) )
return $retNodes;
foreach ( $array as $node )
{
unset( $object );
if( $node['node_id'] == 1 )
{
if( !isset( $node['name'] ) || !$node['name'] )
$node['name'] = ezpI18n::tr( 'kernel/content', 'Top Level Nodes' );
}
$object = new self( $node );
// If the name is not set it will be fetched later on when
// getName()/attribute( 'name' ) is accessed.
if ( isset( $node['name'] ) )
{
$object->setName( $node['name'] );
}
if ( isset( $node['class_serialized_name_list'] ) )
{
$node['class_name'] = eZContentClass::nameFromSerializedString( $node['class_serialized_name_list'] );
$object->ClassName = $node['class_name'];
}
if ( isset( $node['class_identifier'] ) )
$object->ClassIdentifier = $node['class_identifier'];
if ( isset( $node['is_container'] ) )
$object->ClassIsContainer = $node['is_container'];
if ( $with_contentobject )
{
if ( isset( $node['class_name'] ) )
{
unset( $node['remote_id'] );
$contentObject = new eZContentObject( $node );
$permissions = array();
$contentObject->setPermissions( $permissions );
$contentObject->setClassName( $node['class_name'] );
if ( isset( $node['class_identifier'] ) )
$contentObject->ClassIdentifier = $node['class_identifier'];
}
else
{
$contentObject = new eZContentObject( array());
if ( isset( $node['name'] ) )
$contentObject->setCachedName( $node['name'] );
}
if ( isset( $node['real_translation'] ) && $node['real_translation'] != '' )
{
$object->CurrentLanguage = $node['real_translation'];
$contentObject->CurrentLanguage = $node['real_translation'];
}
if ( $node['node_id'] == 1 )
{
$contentObject->ClassName = 'Folder';
$contentObject->ClassIdentifier = 'folder';
$contentObject->ClassID = 1;
$contentObject->SectionID = 1;
}
$object->setContentObject( $contentObject );
}
$retNodes[] = $object;
}
return $retNodes;
}