本文整理汇总了PHP中eZContentOperationCollection类的典型用法代码示例。如果您正苦于以下问题:PHP eZContentOperationCollection类的具体用法?PHP eZContentOperationCollection怎么用?PHP eZContentOperationCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了eZContentOperationCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
function execute($process, $event)
{
// get object being published
$parameters = $process->attribute('parameter_list');
$objectID = $parameters['object_id'];
eZDebug::writeDebug('Update object state for object: ' . $objectID);
$object = eZContentObject::fetch($objectID);
$state_before = $event->attribute('state_before');
$state_after = $event->attribute('state_after');
if ($object == null) {
eZDebug::writeError('Update object state failed for inexisting object: ' . $objectID, __METHOD__);
return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
if ($state_before == null || $state_after == null) {
eZDebug::writeError('Update object state failed: badly configured states', __METHOD__);
return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
$currentStateIDArray = $object->attribute('state_id_array');
if (in_array($state_before->attribute('id'), $currentStateIDArray)) {
$canAssignStateIDList = $object->attribute('allowed_assign_state_id_list');
if (!in_array($state_after->attribute('id'), $canAssignStateIDList)) {
eZDebug::writeWarning("Not enough rights to assign state to object {$objectID}: " . $state_after->attribute('id'), __METHOD__);
} else {
eZDebug::writeDebug('Changing object state from ' . $state_before->attribute('name') . ' to ' . $state_after->attribute('name'), __METHOD__);
if (eZOperationHandler::operationIsAvailable('content_updateobjectstate')) {
$operationResult = eZOperationHandler::execute('content', 'updateobjectstate', array('object_id' => $objectID, 'state_id_list' => array($state_after->attribute('id'))));
} else {
eZContentOperationCollection::updateObjectState($objectID, array($state_after->attribute('id')));
}
}
}
return eZWorkflowType::STATUS_ACCEPTED;
}
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:33,代码来源:objectstateupdatetype.php
示例2: runOperation
function runOperation(&$node)
{
$object = $node->attribute('object');
$object_id = $object->attribute('id');
$objectLocales = $object->attribute('available_languages');
// If the alternative locale does not exist for object, create it
if (!in_array($this->altLocale, $objectLocales)) {
// The only translation is in locate to be removed - create a version in another locale first.
echo "Copying the single translation in " . $this->remLocale . " to " . $this->altLocale . " so former could be removed.\n";
$newVersion = $object->createNewVersionIn($this->altLocale, $this->remLocale, false, true, eZContentObjectVersion::STATUS_DRAFT);
$publishResult = eZOperationHandler::execute('content', 'publish', array('object_id' => $object_id, 'version' => $newVersion->attribute('version')));
eZContentObject::clearCache();
$object = eZContentObject::fetch($object_id);
}
// Change objects main language to alternative language, if its current main language is to be removed.
if ($object->attribute('initial_language_code') == $this->remLocale) {
eZContentObject::clearCache();
$object = eZContentObject::fetch($object_id);
echo "Switching initial language to {$this->altLocale} so that " . $this->remLocale . " could be removed.\n";
$updateResult = eZContentOperationCollection::updateInitialLanguage($object_id, $this->altLangID);
$object->store();
eZContentObject::clearCache();
$object = eZContentObject::fetch($object_id);
}
// Now it should be safe to remove translation.
return $object->removeTranslation($this->remLangID);
}
开发者ID:informaticatrentina,项目名称:batchtool,代码行数:27,代码来源:noderemovetranslation.php
示例3: execute
public function execute($process, $event)
{
$processParameters = $process->attribute('parameter_list');
$object = eZContentObject::fetch($processParameters['object_id']);
$targetClassIdentifier = $object->contentClass()->attribute('identifier');
$iniGroups = eZINI::instance('ngindexer.ini')->groups();
$targets = array();
foreach ($iniGroups as $iniGroupName => $iniGroup) {
$iniGroupNameArray = explode('/', $iniGroupName);
if (is_array($iniGroupNameArray) && count($iniGroupNameArray) == 3) {
$class = eZContentClass::fetchByIdentifier($iniGroupNameArray[0]);
if ($class instanceof eZContentClass) {
$classAttribute = $class->fetchAttributeByIdentifier($iniGroupNameArray[1]);
if ($classAttribute instanceof eZContentClassAttribute) {
$indexTarget = isset($iniGroup['IndexTarget']) ? trim($iniGroup['IndexTarget']) : '';
$referencedClassIdentifiers = isset($iniGroup['ClassIdentifiers']) && is_array($iniGroup['ClassIdentifiers']) ? $iniGroup['ClassIdentifiers'] : null;
if ($referencedClassIdentifiers != null && (empty($referencedClassIdentifiers) || in_array($targetClassIdentifier, $referencedClassIdentifiers))) {
switch ($indexTarget) {
case 'parent':
case 'parent_line':
$children = eZContentObjectTreeNode::subTreeByNodeID(array('ClassFilterType' => 'include', 'ClassFilterArray' => array($iniGroupNameArray[0]), 'Depth' => $indexTarget == 'parent' ? 1 : false), $object->mainNode()->attribute('node_id'));
if (is_array($children)) {
$targets = array_merge($targets, $children);
}
break;
case 'children':
$parentNode = $object->mainNode()->fetchParent();
if ($parentNode->classIdentifier() == $iniGroupNameArray[0]) {
$targets[] = $parentNode;
}
break;
case 'subtree':
$path = $object->mainNode()->fetchPath();
foreach ($path as $pathNode) {
if ($pathNode->classIdentifier() == $iniGroupNameArray[0]) {
$targets[] = $parentNode;
}
}
break;
default:
continue;
}
}
}
}
}
}
$filteredTargets = array();
foreach ($targets as $target) {
$objectID = $target->attribute('contentobject_id');
$version = $target->object()->attribute('current_version');
if (!isset($filteredTargets[$objectID])) {
$filteredTargets[$objectID] = $version;
eZContentOperationCollection::registerSearchObject($objectID, $version);
}
}
return eZWorkflowType::STATUS_ACCEPTED;
}
开发者ID:netgen,项目名称:ngindexer,代码行数:58,代码来源:ngindexertype.php
示例4: sectionEditActionCheck
function sectionEditActionCheck( $module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage )
{
if ( $module->isCurrentAction( 'SectionEdit' ) )
{
$http = eZHTTPTool::instance();
if ( $http->hasPostVariable( 'SelectedSectionId' ) )
{
$selectedSectionID = (int) $http->postVariable( 'SelectedSectionId' );
$selectedSection = eZSection::fetch( $selectedSectionID );
if ( is_object( $selectedSection ) )
{
$currentUser = eZUser::currentUser();
if ( $currentUser->canAssignSectionToObject( $selectedSectionID, $object ) )
{
$db = eZDB::instance();
$db->begin();
$assignedNodes = $object->attribute( 'assigned_nodes' );
if ( count( $assignedNodes ) > 0 )
{
foreach ( $assignedNodes as $node )
{
if ( eZOperationHandler::operationIsAvailable( 'content_updatesection' ) )
{
$operationResult = eZOperationHandler::execute( 'content',
'updatesection',
array( 'node_id' => $node->attribute( 'node_id' ),
'selected_section_id' => $selectedSectionID ),
null,
true );
}
else
{
eZContentOperationCollection::updateSection( $node->attribute( 'node_id' ), $selectedSectionID );
}
}
}
else
{
// If there are no assigned nodes we should update db for the current object.
$objectID = $object->attribute( 'id' );
$db->query( "UPDATE ezcontentobject SET section_id='$selectedSectionID' WHERE id = '$objectID'" );
$db->query( "UPDATE ezsearch_object_word_link SET section_id='$selectedSectionID' WHERE contentobject_id = '$objectID'" );
}
$object->expireAllViewCache();
$db->commit();
}
else
{
eZDebug::writeError( "You do not have permissions to assign the section <" . $selectedSection->attribute( 'name' ) .
"> to the object <" . $object->attribute( 'name' ) . ">." );
}
$module->redirectToView( 'edit', array( $object->attribute( 'id' ), $editVersion, $editLanguage, $fromLanguage ) );
}
}
}
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:57,代码来源:section_edit.php
示例5: runOperation
function runOperation(&$node)
{
if (eZOperationHandler::operationIsAvailable('content_updatealwaysavailable')) {
$operationResult = eZOperationHandler::execute('content', 'updatealwaysavailable', array('object_id' => $node->attribute('contentobject_id'), 'new_always_available' => $this->available, 'node_id' => $node->attribute('node_id')));
} else {
eZContentOperationCollection::updateAlwaysAvailable($node->attribute('contentobject_id'), $this->available);
}
return true;
}
开发者ID:informaticatrentina,项目名称:batchtool,代码行数:9,代码来源:nodealwaysavailable.php
示例6: testRemoveAssignments
/**
* Test to verify that eznode_assignment entres get removed.
*
* @link http://issues.ez.no/15478
*/
public function testRemoveAssignments()
{
$db = eZDB::instance();
$testSet = array();
$folder = new ezpObject( "folder", 2 );
$folder->name = __FUNCTION__;
$folder->publish();
$testSet[] = $folder;
$childOne = new ezpObject( "folder", $folder->mainNode->node_id );
$childOne->name = "ChildOne";
$childOne->publish();
$testSet[] = $childOne;
$childTwo = new ezpObject( "folder", $folder->mainNode->node_id );
$childTwo->name = "ChildTwo";
$childTwo->publish();
$testSet[] = $childTwo;
$subChildOne = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildOne->title = "SubChild";
$subChildOne->publish();
$testSet[] = $subChildOne;
$subChildTwo = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildTwo->title = "SubChildOther";
$subChildTwo->publish();
$testSet[] = $subChildTwo;
$subChildThree = new ezpObject( 'article', $childOne->mainNode->node_id );
$subChildThree->title = "SubChildThird";
$subChildThree->publish();
$testSet[] = $subChildThree;
// Let's add another placement here
$newPlacementSubChildOne = $subChildOne->addNode( $childTwo->mainNode->node_id );
$testSet[] = $newPlacementSubChildOne;
// $this->debugBasicNodeInfo( $testSet );
$coId = $newPlacementSubChildOne->attribute( 'contentobject_id' );
eZContentOperationCollection::removeAssignment( $childTwo->mainNode->node_id, $childTwo->id, array( $newPlacementSubChildOne ), false );
$checkSql = "SELECT * FROM eznode_assignment WHERE contentobject_id = {$coId}";
$result = $db->arrayQuery( $checkSql );
// After removing one of the assignments, the number of node
// assignments for the content object should be only one.
$numberOfAssignments = count( $result );
self::assertEquals( 1, $numberOfAssignments, "The number of node assignments are not correct, eznode_assignment table not cleaned up correctly." );
}
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:60,代码来源:ezcontentoperationcollection_regression.php
示例7: stateEditActionCheck
function stateEditActionCheck($module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage)
{
if ($module->isCurrentAction('StateEdit')) {
$http = eZHTTPTool::instance();
if ($http->hasPostVariable('SelectedStateIDList')) {
$selectedStateIDList = $http->postVariable('SelectedStateIDList');
$objectID = $object->attribute('id');
if (eZOperationHandler::operationIsAvailable('content_updateobjectstate')) {
$operationResult = eZOperationHandler::execute('content', 'updateobjectstate', array('object_id' => $objectID, 'state_id_list' => $selectedStateIDList));
} else {
eZContentOperationCollection::updateObjectState($objectID, $selectedStateIDList);
}
}
}
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:15,代码来源:state_edit.php
示例8: updateNodeVisibility
/**
* @param int $nodeID
* @param string $action
*/
public function updateNodeVisibility( $nodeID, $action )
{
$node = eZContentObjectTreeNode::fetch( $nodeID );
eZContentOperationCollection::registerSearchObject($node->attribute( 'contentobject_id' ));
if ( $node->childrenCount( false ) )
{
$pendingAction = new eZPendingActions(
array(
'action' => self::PENDING_ACTION_INDEX_SUBTREE,
'created' => time(),
'param' => $nodeID
)
);
$pendingAction->store();
}
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:22,代码来源:kezsolr.php
示例9: updatePriority
/**
* Updating priority sorting for given node
*
* @param mixed $args
* @return array
*/
public static function updatePriority( $args )
{
$http = eZHTTPTool::instance();
if ( !$http->hasPostVariable('ContentNodeID')
|| !$http->hasPostVariable('PriorityID')
|| !$http->hasPostVariable('Priority') )
{
return array();
}
$contentNodeID = $http->postVariable('ContentNodeID');
$priorityArray = $http->postVariable('Priority');
$priorityIDArray = $http->postVariable('PriorityID');
$contentNode = eZContentObjectTreeNode::fetch( $contentNodeID );
if ( !$contentNode->attribute( 'can_edit' ) )
{
eZDebug::writeError( 'Current user can not update the priorities because he has no permissions to edit the node' );
return array();
}
if ( eZOperationHandler::operationIsAvailable( 'content_updatepriority' ) )
{
$operationResult = eZOperationHandler::execute( 'content', 'updatepriority',
array( 'node_id' => $contentNodeID,
'priority' => $priorityArray,
'priority_id' => $priorityIDArray ), null, true );
}
else
{
eZContentOperationCollection::updatePriority( $contentNodeID, $priorityArray, $priorityIDArray );
}
if ( $http->hasPostVariable( 'ContentObjectID' ) )
{
$objectID = $http->postVariable( 'ContentObjectID' );
eZContentCacheManager::clearContentCache( $objectID );
}
}
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:46,代码来源:ezwtservercallfunctions.php
示例10: execute
public function execute($process, $event)
{
//echo('*** workflow importcomunicati ***<pre>');
$parameters = $process->attribute('parameter_list');
try {
$object = eZContentObject::fetch($parameters['object_id']);
// if a newer object is the current version, abort this workflow.
$currentVersion = $object->attribute('current_version');
$version = $object->version($parameters['version']);
$classIdentifier = $version->ContentObject->ClassIdentifier;
// Verifica se la classe è corretta
if ($classIdentifier == self::PUBLISH_CLASS) {
$objectAttributes = $version->attribute('contentobject_attributes');
// cicla sugl iattributi
foreach ($objectAttributes as $objectAttribute) {
$contentClassAttributeIdentifier = $objectAttribute->ContentClassAttributeIdentifier;
if ($contentClassAttributeIdentifier == 'published') {
// recupera la data di pubblicazione
$publisheddate = $objectAttribute->attribute('content');
}
}
// set della data di pubblicazione
if ($publisheddate instanceof eZDateTime || $publisheddate instanceof eZDate) {
$object->setAttribute('published', $publisheddate->timeStamp());
$object->store();
eZContentOperationCollection::registerSearchObject($object->attribute('id'));
eZDebug::writeNotice('Workflow change object publish date', __METHOD__);
}
//echo('<br>*** die workflow ***');
//die();
}
return eZWorkflowType::STATUS_ACCEPTED;
} catch (Exception $e) {
eZDebug::writeError($e->getMessage(), __METHOD__);
return eZWorkflowType::STATUS_REJECTED;
}
}
开发者ID:informaticatrentina,项目名称:pat_base,代码行数:37,代码来源:importcomunicatitype.php
示例11: executeTrigger
/**
* Executes an operation trigger
*
* @param array $bodyReturnValue The current return value
* @param array $body Body data for the trigger being executed
* @param array $operationParameterDefinitions Operation parameters definition
* @param array $operationParameters Operation parameters values
* @param int $bodyCallCount Number of times the body was called
* @param array $currentLoopData Memento data for the operation
* @param bool $triggerRestored Boolean that indicates if operation data (memento) was restored
* @param string $operationName The operation name
* @param array $operationKeys Additional parameters. Only used by looping so far.
* @return
*/
function executeTrigger(&$bodyReturnValue, $body, $operationParameterDefinitions, $operationParameters, &$bodyCallCount, $currentLoopData, $triggerRestored, $operationName, &$operationKeys)
{
$triggerName = $body['name'];
$triggerKeys = $body['keys'];
$status = eZTrigger::runTrigger($triggerName, $this->ModuleName, $operationName, $operationParameters, $triggerKeys);
if ($status['Status'] == eZTrigger::WORKFLOW_DONE || $status['Status'] == eZTrigger::NO_CONNECTED_WORKFLOWS) {
++$bodyCallCount['loop_run'][$triggerName];
return eZModuleOperationInfo::STATUS_CONTINUE;
} else {
if ($status['Status'] == eZTrigger::STATUS_CRON_JOB || $status['Status'] == eZTrigger::FETCH_TEMPLATE || $status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT || $status['Status'] == eZTrigger::REDIRECT) {
$bodyMemento = $this->storeBodyMemento($triggerName, $triggerKeys, $operationKeys, $operationParameterDefinitions, $operationParameters, $bodyCallCount, $currentLoopData, $operationName);
$workflowProcess = $status['WorkflowProcess'];
if ($workflowProcess !== null) {
$workflowProcess->setAttribute('memento_key', $bodyMemento->attribute('memento_key'));
$workflowProcess->store();
}
$bodyReturnValue['result'] = $status['Result'];
if ($status['Status'] == eZTrigger::REDIRECT) {
$bodyReturnValue['redirect_url'] = $status['Result'];
}
if ($status['Status'] == eZTrigger::FETCH_TEMPLATE_REPEAT) {
// Hack for project issue #14371 (fetch template repeat)
// The object version's status is set to REPEAT so that it can
// be submitted again
if ($operationName == 'publish' && $this->ModuleName == 'content') {
eZContentOperationCollection::setVersionStatus($operationParameters['object_id'], $operationParameters['version'], eZContentObjectVersion::STATUS_REPEAT);
}
return eZModuleOperationInfo::STATUS_REPEAT;
} else {
return eZModuleOperationInfo::STATUS_HALTED;
}
} else {
if ($status['Status'] == eZTrigger::WORKFLOW_CANCELLED or $status['Status'] == eZTrigger::WORKFLOW_RESET) {
return eZModuleOperationInfo::STATUS_CANCELLED;
$bodyReturnValue['result'] = $status['Result'];
}
}
}
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:53,代码来源:ezmoduleoperationinfo.php
示例12: foreach
// to do this the following must be true:
// - The total child count must be zero
// - There must be no object removal (i.e. it is the only node for the object)
if ($totalChildCount == 0) {
$canRemove = true;
foreach ($deleteResult as $item) {
if ($item['object_node_count'] <= 1) {
$canRemove = false;
break;
}
}
if ($canRemove) {
if (eZOperationHandler::operationIsAvailable('content_removelocation')) {
$operationResult = eZOperationHandler::execute('content', 'removelocation', array('node_list' => array_keys($deleteNodeIdArray), 'move_to_trash' => $moveToTrash), null, true);
} else {
eZContentOperationCollection::removeNodes(array_keys($deleteNodeIdArray));
}
if ($http->hasSessionVariable('RedirectURIAfterRemove') && $http->sessionVariable('RedirectURIAfterRemove')) {
$Module->redirectTo($http->sessionVariable('RedirectURIAfterRemove'));
$http->removeSessionVariable('RedirectURIAfterRemove');
return $http->removeSessionVariable('RedirectIfCancel');
} else {
return $Module->redirectToView('view', array($viewMode, $contentNodeID, $contentLanguage));
}
}
}
$tpl = eZTemplate::factory();
$tpl->setVariable('reverse_related', $info['reverse_related_count']);
$tpl->setVariable('module', $Module);
$tpl->setVariable('moveToTrashAllowed', $moveToTrashAllowed);
// Backwards compatibility
开发者ID:legende91,项目名称:ez,代码行数:31,代码来源:removeobject.php
示例13: testRemoveOldNodes
/**
* Fatal Error when calling eZContentOperationCollection::removeOldNodes()
* with inexistant object/object version
*
* @link http://issues.ez.no/22232
*/
public function testRemoveOldNodes()
{
eZContentOperationCollection::removeOldNodes(1234, 1234);
}
开发者ID:CG77,项目名称:ezpublish-legacy,代码行数:10,代码来源:ezcontentoperationcollection_test.php
示例14: updateObjectState
/**
* Update search index when object state changes
*
* @param int $objectID
* @param array $objectStateList
*/
public function updateObjectState($objectID, $objectStateList)
{
eZContentOperationCollection::registerSearchObject($objectID);
}
开发者ID:harmstyler,项目名称:ezplatformsearch,代码行数:10,代码来源:ezplatformsearch.php
示例15: implode
$cli->output('Published : Starting.');
$cli->output('Supported Classes : ' . implode(', ', $unpublishClasses));
foreach ($rootNodeIDList as $nodeID) {
$rootNode = eZContentObjectTreeNode::fetch($nodeID);
$articleNodeArray = $rootNode->subTree(array('ClassFilterType' => 'include', 'ClassFilterArray' => $unpublishClasses));
foreach ($articleNodeArray as $articleNode) {
$article = $articleNode->attribute('object');
// Si le contenu est à l'état Mise en ligne programmée 'publish_chain/waituntildate'
if (in_array($ini->variable('UpdateObjectStatesSettings', 'PendingObjectState'), $article->attribute('state_id_array'))) {
$dataMap = $article->attribute('data_map');
$dateAttribute = $dataMap['publish_date'];
if ($dateAttribute === null) {
continue;
}
$date = $dateAttribute->content();
$articleRetractDate = $date->attribute('timestamp');
if ($articleRetractDate > 0 && $articleRetractDate < $currrentDate) {
$ok = "NOT-OK";
// Switch Object state to Published
if (eZOperationHandler::operationIsAvailable('content_updateobjectstate')) {
$operationResult = eZOperationHandler::execute('content', 'updateobjectstate', array('object_id' => $articleNode->attribute('contentobject_id'), 'state_id_list' => array($targetState)));
$ok = "OK";
} else {
eZContentOperationCollection::updateObjectState($articleNode->attribute('contentobject_id'), array($targetState));
$ok = "OK";
}
$cli->output('Archived : ' . $ok . ' - ' . $articleNode->attribute('name'));
}
}
}
}
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:31,代码来源:publish.php
示例16: testRemovePendingSearchNotAllNodesRemoved
/**
* Same test as {@link self::testRemovePendingSearchSeveralNodesForObject()}, with not all nodes removed
* Use case
* --------
* 1. If all nodes are removed, pending action must also be removed
* 2. If NOT all nodes are removed (at least one node remaining for object), pending action must NOT be removed (case tested here)
*
* @group issue_17932
*/
public function testRemovePendingSearchNotAllNodesRemoved()
{
$this->folder->addNode( 43 );
$folderObjectID = $this->folder->object->attribute( 'id' );
$aNodeID = array( $this->folder->nodes[0]->attribute( 'node_id' ) ); // Only delete the first node
eZContentOperationCollection::deleteObject( $aNodeID );
$filterConds = array(
'action' => 'index_object',
'param' => $folderObjectID
);
$pendingCount = eZPersistentObject::count( eZPendingActions::definition(), $filterConds );
self::assertGreaterThan( 0, $pendingCount, "eZContentOperationCollection::deleteObject() must remove pending action for object #$folderObjectID as all nodes have been removed" );
}
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:24,代码来源:ezcontentoperationdelete_regression.php
示例17: foreach
if ( empty($rows) )
{
$continue = false;
break;
}
foreach( $rows as $row )
{
$remoteId = $row['remote_id'];
$object = eZContentObject::fetchByRemoteID($remoteId);
//if eZ Publish object
if ($object)
{
$counter++;
eZContentOperationCollection::registerSearchObject($object->attribute("id"), false);
$varnishNodeIds[] = $object->mainNode()->attribute('parent_node_id');
}
else
{
$counter++;
//test if solrObject
$fields = array(
'rating' => 'attr_content_rating_'.$row['cluster_identifier'].'_f',
);
$params = array(
'indent' => 'on',
'q' => '*:*',
'start' => 0,
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:kezupdateratingindex.php
示例18: applyTo
public function applyTo(eZContentObject $object)
{
$sectionID = $this->attribute("id");
$currentUser = eZUser::currentUser();
if (!$currentUser->canAssignSectionToObject($sectionID, $object)) {
eZDebug::writeError("You do not have permissions to assign the section <" . $selectedSection->attribute("name") . "> to the object <" . $object->attribute("name") . ">.");
return false;
}
$db = eZDB::instance();
$db->begin();
$assignedNodes = $object->attribute("assigned_nodes");
if (!empty($assignedNodes)) {
if (eZOperationHandler::operationIsAvailable("content_updatesection")) {
foreach ($assignedNodes as $node) {
eZOperationHandler::execute("content", "updatesection", array("node_id" => $node->attribute("node_id"), "selected_section_id" => $sectionID), null, true);
}
} else {
foreach ($assignedNodes as $node) {
eZContentOperationCollection::updateSection($node->attribute("node_id"), $sectionID);
}
}
} else {
// If there are no assigned nodes we should update db for the current object.
$objectID = $object->attribute("id");
$db->query("UPDATE ezcontentobject SET section_id='{$sectionID}' WHERE id = '{$objectID}'");
$db->query("UPDATE ezsearch_object_word_link SET section_id='{$sectionID}' WHERE contentobject_id = '{$objectID}'");
}
eZContentCacheManager::clearContentCacheIfNeeded($object->attribute("id"));
$object->expireAllViewCache();
$db->commit();
}
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:31,代码来源:ezsection.php
示例19: addNodeAssignment
/**
* Called when a node assignement is added to an object.
* Simply re-index for now.
*
* @todo: defer to cron if there are children involved and re-index these too
* @todo when Solr supports it: update fields only
*
* @param $mainNodeID
* @param $objectID
* @param $nodeAssignmentIDList
* @return unknown_type
* @see eZSearch::addNodeAssignment()
*/
public function addNodeAssignment( $mainNodeID, $objectID, $nodeAssignmentIDList )
{
eZContentOperationCollection::registerSearchObject( $objectID );
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:17,代码来源:ezsolr.php
示例20: doRemove
/**
* Does the remove job.
* Will use content_delete operation if available (workflow support)
* @param array $aNodeID
* @param bool $moveToTrash Indicates if we move content to trash or not. True by default
* @internal
*/
private function doRemove(array $aNodeID, $moveToTrash = true)
{
if (eZOperationHandler::operationIsAvailable('content_delete')) {
$operationResult = eZOperationHandler::execute('content', 'delete', array('node_id_list' => $aNodeID, 'move_to_trash' => $moveToTrash), null, true);
} else {
eZContentOperationCollection::deleteObject($aNodeID, $moveToTrash);
}
}
开发者ID:nicolasaguenot,项目名称:sqliimport,代码行数:15,代码来源:sqlicontent.php
注:本文中的eZContentOperationCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论