当前位置: 首页>>代码示例>>PHP>>正文


PHP eZContentCacheManager::clearObjectViewCacheIfNeeded方法代码示例

本文整理汇总了PHP中eZContentCacheManager::clearObjectViewCacheIfNeeded方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentCacheManager::clearObjectViewCacheIfNeeded方法的具体用法?PHP eZContentCacheManager::clearObjectViewCacheIfNeeded怎么用?PHP eZContentCacheManager::clearObjectViewCacheIfNeeded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZContentCacheManager的用法示例。


在下文中一共展示了eZContentCacheManager::clearObjectViewCacheIfNeeded方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: removeNodes

 /**
  * Removes nodes
  *
  * This function does not check about permissions, this is the responsibility of the caller!
  *
  * @param array $removeNodeIdList Array of Node ID to remove
  *
  * @return array An array with operation status, always true
  */
 public static function removeNodes(array $removeNodeIdList)
 {
     $mainNodeChanged = array();
     $nodeAssignmentIdList = array();
     $objectIdList = array();
     $db = eZDB::instance();
     $db->begin();
     foreach ($removeNodeIdList as $nodeId) {
         $node = eZContentObjectTreeNode::fetch($nodeId);
         $objectId = $node->attribute('contentobject_id');
         foreach (eZNodeAssignment::fetchForObject($objectId, eZContentObject::fetch($objectId)->attribute('current_version'), 0, false) as $nodeAssignmentKey => $nodeAssignment) {
             if ($nodeAssignment['parent_node'] == $node->attribute('parent_node_id')) {
                 $nodeAssignmentIdList[$nodeAssignment['id']] = 1;
             }
         }
         if ($nodeId == $node->attribute('main_node_id')) {
             $mainNodeChanged[$objectId] = 1;
         }
         $node->removeThis();
         if (!isset($objectIdList[$objectId])) {
             $objectIdList[$objectId] = eZContentObject::fetch($objectId);
         }
     }
     eZNodeAssignment::purgeByID(array_keys($nodeAssignmentIdList));
     foreach (array_keys($mainNodeChanged) as $objectId) {
         $allNodes = $objectIdList[$objectId]->assignedNodes();
         // Registering node that will be promoted as 'main'
         $mainNodeChanged[$objectId] = $allNodes[0];
         eZContentObjectTreeNode::updateMainNodeID($allNodes[0]->attribute('node_id'), $objectId, false, $allNodes[0]->attribute('parent_node_id'));
     }
     // Give other search engines that the default one a chance to reindex
     // when removing locations.
     if (!eZSearch::getEngine() instanceof eZSearchEngine) {
         foreach (array_keys($objectIdList) as $objectId) {
             eZContentOperationCollection::registerSearchObject($objectId);
         }
     }
     $db->commit();
     //call appropriate method from search engine
     eZSearch::removeNodes($removeNodeIdList);
     $userClassIdList = eZUser::contentClassIDs();
     foreach ($objectIdList as $objectId => $object) {
         eZContentCacheManager::clearObjectViewCacheIfNeeded($objectId);
         // clear user policy cache if this was a user object
         if (in_array($object->attribute('contentclass_id'), $userClassIdList)) {
             eZUser::purgeUserCacheByUserId($object->attribute('id'));
         }
     }
     // we don't clear template block cache here since it's cleared in eZContentObjectTreeNode::removeNode()
     return array('status' => true);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:60,代码来源:ezcontentoperationcollection.php

示例2: array

             if ($newValue != $currentValue) {
                 if ($createNewVersion) {
                     $params = array('attributes' => array($attributeIdentifier => $newValue));
                     $result = eZContentFunctions::updateAndPublishObject($object, $params);
                     if (!$result) {
                         $data['status'] = 'error';
                         $data['message'] = "Error creating new object version";
                         $data['header'] = "HTTP/1.1 400 Bad Request";
                     } else {
                         $data['status'] = 'success';
                     }
                 } else {
                     $attribute->fromString($newValue);
                     $attribute->store();
                     eZSearch::addObject($object);
                     eZContentCacheManager::clearObjectViewCacheIfNeeded($object->attribute('id'));
                     $data['status'] = 'success';
                 }
             }
         } else {
             $data['status'] = 'error';
             $data['message'] = "Attribute not found";
             $data['header'] = "HTTP/1.1 404 Not Found";
         }
     } else {
         $data['status'] = 'error';
         $data['message'] = "Attribute not found";
         $data['header'] = "HTTP/1.1 404 Not Found";
     }
 } else {
     $data['status'] = 'error';
开发者ID:OpencontentCoop,项目名称:ocoperatorscollection,代码行数:31,代码来源:attribute.php

示例3: eZIEImagePreAction

 * File containing the ezie no save & quit menu item handler
 *
 * @copyright Copyright (C) eZ Systems AS.
 * @license For full copyright and license information view LICENSE file distributed with this source code.
 * @version //autogentag//
 * @package ezie
 */
$prepare_action = new eZIEImagePreAction();
$imageId = $prepare_action->getImageId();
$imageVersion = $prepare_action->getImageVersion();
$imageAttribute = eZContentObjectAttribute::fetch($imageId, $imageVersion);
// Save the class attribute
$imageHandler = $prepare_action->getImageHandler();
$imageHandler->initializeFromFile($prepare_action->getImagePath(), $imageHandler->attribute('alternative_text'), $imageHandler->attribute('original_filename'));
// TODO: what's $contentobjectattribute (ask jerome) ?
$imageHandler->store($imageAttribute);
// remove view cache if needed
eZContentCacheManager::clearObjectViewCacheIfNeeded($imageAttribute->attribute('contentobject_id'));
// delete all the images in working directory
// delete working directory
$working_folder = eZDir::dirpath($prepare_action->getImagePath());
// deletes the working folder recursively
eZDir::recursiveDelete($working_folder);
// new attribute
$imageAttribute = eZContentObjectAttribute::fetch($imageId, $imageVersion);
// @todo Use proper JSON, but this will do for now.
$tpl = eZTemplate::factory();
$tpl->setVariable('ezie_ajax_response', true);
$tpl->setVariable('attribute', $imageAttribute);
echo $tpl->fetch("design:content/datatype/edit/ezimage.tpl");
eZExecution::cleanExit();
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:31,代码来源:save_and_quit.php

示例4: clearContentCacheIfNeeded

 static function clearContentCacheIfNeeded($objectID, $versionNum = true, $additionalNodeList = false)
 {
     eZDebug::accumulatorStart('check_cache', '', 'Check cache');
     eZContentCacheManager::clearObjectViewCacheIfNeeded($objectID, $versionNum, $additionalNodeList);
     eZContentCacheManager::clearTemplateBlockCacheIfNeeded($objectID);
     // Clear cached path strings of content SSL zones.
     eZSSLZone::clearCacheIfNeeded();
     eZDebug::accumulatorStop('check_cache');
     return true;
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:10,代码来源:ezcontentcachemanager.php

示例5: editContentObject


//.........这里部分代码省略.........
                                    $newRow['name'] = 'Row_' . ( $matrix->NumRows + 1 );
                                    $matrix->NumRows++;
                                    $matrix->Matrix['rows']['sequential'][] = $newRow;
                                }
                                $matrix->Cells = $cells;
                                $attribute->setAttribute( 'data_text', $matrix->xmlString() );
                                $matrix->decodeXML( $attribute->attribute( 'data_text' ) );
                                $attribute->setContent( $matrix );
                            }
                        } break;


                        case 'ezauthor':
                        case 'ezbinaryfile':
                        case 'ezcountry':
                        case 'ezdate':
                        case 'ezdatetime':
                        case 'ezenum':
                        case 'ezidentifier':
                        case 'ezinisetting':
                        case 'ezisbn':
                        case 'ezmedia':
                        case 'ezmultioption':
                        case 'ezmultiprice':
                        case 'ezobjectrelationlist':
                        case 'ezoption':
                        case 'ezpackage':
                        case 'ezproductcategory':
                        case 'ezrangeoption':
                        case 'ezsubtreesubscription':
                        case 'eztime':
                        {
                            $this->writeMessage( "\tDatatype " . $dataType . " not supported yet.", 'warning' );
                        } break;

                    }
                    $attribute->store();
                }
            }
            if ( isset($objectInformation['sectionID']) && $objectInformation['sectionID'] != '' && $objectInformation['sectionID'] != 0 )
            {
                $contentObject->setAttribute( 'section_id',  $objectInformation['sectionID'] );
            }

            if ( isset($objectInformation['creatorID']) && $objectInformation['creatorID'] != '' && $objectInformation['creatorID'] != 0 )
            {
                $contentObjectVersion->setAttribute( 'creator_id',  $objectInformation['creatorID'] );
            }

            if ( isset($objectInformation['ownerID']) && $objectInformation['ownerID'] != '' && $objectInformation['ownerID'] != 0 )
            {
                $contentObject->setAttribute( 'owner_id',  $objectInformation['ownerID'] );
            }

            $contentObjectVersion->store();
            $contentObject->store();
            $db->commit();

            eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObject->attribute( 'id' ), 'version'   => $versionNumber ) );

            // set chosen hidden/invisible attributes for object nodes
            $http          = eZHTTPTool::instance();
            $assignedNodes = $contentObject->assignedNodes( true );
            foreach ( $assignedNodes as $node )
            {
                $nodeID               = $node->attribute( 'node_id' );
                $parentNodeID         = $node->attribute( 'parent_node_id' );

                $db = eZDB::instance();
                $db->begin();
                $parentNode = eZContentObjectTreeNode::fetch( $parentNodeID );
                eZContentObjectTreeNode::updateNodeVisibility( $node, $parentNode, /* $recursive = */ false );
                $db->commit();
                unset( $node, $parentNode );
            }
            unset( $assignedNodes );




            eZContentCacheManager::clearObjectViewCacheIfNeeded( $contentObject->attribute( 'id' ) );

            $newNodeArray = eZContentObjectTreeNode::fetchByContentObjectID( $contentObject->attribute( 'id' ) );
            $refArray = false;
            if ( $newNodeArray && count($newNodeArray) >= 1 )
            {
                $newNode = $newNodeArray[0];
                if ( $newNode )
                {
                    $refArray = array( "node_id"   => $newNode->attribute( 'node_id' ),
                                       "name"      => $contentObject->attribute( 'name' ),
                                       "object_id" => $contentObject->attribute( 'id' ) );
                }
            }
            unset($contentObjectVersion);
            unset($contentObject);
            return $refArray;
        }
        return false;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:101,代码来源:ezmodifycontent.php


注:本文中的eZContentCacheManager::clearObjectViewCacheIfNeeded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。