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; }