本文整理汇总了PHP中eZContentClass::nameFromSerializedString方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentClass::nameFromSerializedString方法的具体用法?PHP eZContentClass::nameFromSerializedString怎么用?PHP eZContentClass::nameFromSerializedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentClass
的用法示例。
在下文中一共展示了eZContentClass::nameFromSerializedString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeObjectsArray
public static function makeObjectsArray($array, $with_contentobject = true, array $propertiesOverride = null)
{
$retNodes = array();
if (!is_array($array)) {
return $retNodes;
}
foreach ($array as $node) {
if ($propertiesOverride !== null) {
$node = $propertiesOverride + $node;
}
if ($node['node_id'] == 1 && (!array_key_exists('name', $node) || !$node['name'])) {
$node['name'] = ezpI18n::tr('kernel/content', 'Top Level Nodes');
}
$object = new eZContentObjectTreeNode(array("node_id" => $node["node_id"], "parent_node_id" => $node["parent_node_id"], "main_node_id" => $node["main_node_id"], "contentobject_id" => isset($node["id"]) ? $node["id"] : $node["contentobject_id"], "contentobject_version" => $node["contentobject_version"], "contentobject_is_published" => $node["contentobject_is_published"], "depth" => $node["depth"], "sort_field" => $node["sort_field"], "sort_order" => $node["sort_order"], "priority" => $node["priority"], "modified_subnode" => $node["modified_subnode"], "path_string" => $node["path_string"], "path_identification_string" => $node["path_identification_string"], "remote_id" => $node["remote_id"], "is_hidden" => $node["is_hidden"], "is_invisible" => $node["is_invisible"]));
// 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'])) {
$row = array("id" => $node["id"], "section_id" => $node["section_id"], "owner_id" => $node["owner_id"], "contentclass_id" => $node["contentclass_id"], "name" => $node["name"], "published" => $node["published"], "modified" => $node["modified"], "current_version" => $node["current_version"], "status" => $node["status"], "remote_id" => $node["object_remote_id"], "language_mask" => $node["language_mask"], "initial_language_id" => $node["initial_language_id"], "class_name" => $node["class_name"]);
if (isset($node['class_identifier'])) {
$row['class_identifier'] = $node['class_identifier'];
}
$contentObject = new eZContentObject($row);
} 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;
}
示例2: className
/**
* Returns the name of the class which this object was created from.
*
* The object will cache the class name information so multiple calls will be fast.
*
* @return string|bool|null
*/
function className()
{
if ( !is_numeric( $this->ClassID ) )
{
return null;
}
if ( $this->ClassName !== false )
return $this->ClassName;
$db = eZDB::instance();
$id = (int)$this->ClassID;
$sql = "SELECT serialized_name_list FROM ezcontentclass WHERE id=$id and version=0";
$rows = $db->arrayQuery( $sql );
if ( count( $rows ) > 0 )
{
$this->ClassName = eZContentClass::nameFromSerializedString( $rows[0]['serialized_name_list'] );
}
return $this->ClassName;
}
示例3: 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;
}
示例4: createContentStructureNode
function createContentStructureNode(&$treeNode, $childrenCount)
{
$node = array('node' => array('node_id' => $treeNode['node_id'], 'path_identification_string' => $treeNode['path_identification_string'], 'children_count' => $childrenCount, 'sort_array' => eZContentObjectTreeNode::sortArrayBySortFieldAndSortOrder($treeNode['sort_field'], $treeNode['sort_order']), 'path_string' => $treeNode['path_string'], 'depth' => $treeNode['depth'], 'is_hidden' => $treeNode['is_hidden'], 'is_invisible' => $treeNode['is_invisible']), 'classes_js_array' => eZContentObjectTreeNode::availableClassListJsArray(array('path_string' => $treeNode['path_string'], 'is_container' => $treeNode['is_container'], 'node_id' => $treeNode['node_id'])), 'object' => array('id' => $treeNode['id'], 'name' => $treeNode['name'], 'class_identifier' => $treeNode['class_identifier'], 'class_name' => eZContentClass::nameFromSerializedString($treeNode['class_serialized_name_list']), 'published' => $treeNode['published'], 'is_container' => $treeNode['is_container'] == '1', 'language_js_array' => eZContentLanguage::jsArrayByMask($treeNode['language_mask'])));
return $node;
}