本文整理匯總了PHP中eZContentObject::unserialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentObject::unserialize方法的具體用法?PHP eZContentObject::unserialize怎麽用?PHP eZContentObject::unserialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentObject
的用法示例。
在下文中一共展示了eZContentObject::unserialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: installContentObjects
function installContentObjects( $objectNodes, $topNodeListNode, &$installParameters )
{
if ( isset( $installParameters['user_id'] ) )
$userID = $installParameters['user_id'];
else
$userID = eZUser::currentUserID();
$handlerType = $this->handlerType();
$firstInstalledID = null;
foreach( $objectNodes as $objectNode )
{
$realObjectNode = $this->getRealObjectNode( $objectNode );
// Cycle until we reach an element where error has occured.
// If action has been choosen, try install this item again, else skip it.
if ( isset( $installParameters['error']['error_code'] ) &&
!$this->isErrorElement( $realObjectNode->getAttribute( 'remote_id' ), $installParameters ) )
{
continue;
}
//we are here, it means we'll try to install some object.
if ( !$firstInstalledID )
{
$firstInstalledID = $realObjectNode->getAttribute( 'remote_id' );
}
$newObject = eZContentObject::unserialize( $this->Package, $realObjectNode, $installParameters, $userID, $handlerType );
if ( !$newObject )
{
return false;
}
if ( is_object( $newObject ) )
{
eZContentObject::clearCache( $newObject->attribute( 'id' ) );
unset( $newObject );
}
unset( $realObjectNode );
if ( isset( $installParameters['error'] ) && count( $installParameters['error'] ) )
{
$installParameters['error'] = array();
}
}
$this->installSuspendedNodeAssignment( $installParameters );
$this->installSuspendedObjectRelations( $installParameters );
// Call postUnserialize on all installed objects
foreach( $objectNodes as $objectNode )
{
if ( $objectNode->localName == 'object' )
{
$remoteID = $objectNode->getAttribute( 'remote_id' );
}
else
{
$remoteID = substr( $objectNode->getAttribute( 'filename' ), 7, 32 );
}
// Begin from the object that we started from in the previous cycle
if ( $firstInstalledID && $remoteID != $firstInstalledID )
{
continue;
}
else
{
$firstInstalledID = null;
}
$object = eZContentObject::fetchByRemoteID( $remoteID );
if ( is_object( $object ) )
{
$object->postUnserialize( $this->Package );
eZContentObject::clearCache( $object->attribute( 'id' ) );
}
unset( $object );
}
return true;
}