| [ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Definition of eZContentObjectOperations class 4 // 5 // Created on: <23-Jan-2006 14:38:57 vs> 6 // 7 // SOFTWARE NAME: eZ publish 8 // SOFTWARE RELEASE: 3.9.0 9 // BUILD VERSION: 17785 10 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 11 // SOFTWARE LICENSE: GNU General Public License v2.0 12 // NOTICE: > 13 // This program is free software; you can redistribute it and/or 14 // modify it under the terms of version 2.0 of the GNU General 15 // Public License as published by the Free Software Foundation. 16 // 17 // This program is distributed in the hope that it will be useful, 18 // but WITHOUT ANY WARRANTY; without even the implied warranty of 19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 // GNU General Public License for more details. 21 // 22 // You should have received a copy of version 2.0 of the GNU General 23 // Public License along with this program; if not, write to the Free 24 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 25 // MA 02110-1301, USA. 26 // 27 // 28 29 /*! \file ezcontentobjectoperations.php 30 */ 31 32 /*! 33 \class eZContentObjectOperations ezcontentobjectoperations.php 34 \brief The class eZContentObjectOperations is a place where 35 content object operations are encapsulated. 36 We move them out from eZContentObject because they may content code 37 which is not directly related to content objects (e.g. clearing caches, etc). 38 */ 39 40 include_once ( 'kernel/classes/ezcontentobject.php' ); 41 42 class eZContentObjectOperations 43 { 44 /*! 45 Removes content object and all data associated with it. 46 \static 47 */ 48 function remove( $objectID, $removeSubtrees = true ) 49 { 50 include_once ( 'kernel/classes/ezcontentcachemanager.php' ); 51 eZContentCacheManager::clearContentCacheIfNeeded( $objectID ); 52 53 $object =& eZContentObject::fetch( $objectID ); 54 if ( !is_object( $object ) ) 55 return false; 56 57 // TODO: Is content cache cleared for all objects in subtree ?? 58 59 if ( $removeSubtrees ) 60 { 61 $assignedNodes = $object->attribute( 'assigned_nodes' ); 62 if ( count( $assignedNodes ) == 0 ) 63 { 64 $object->purge(); 65 eZContentObject::expireAllViewCache(); 66 return true; 67 } 68 $assignedNodeIDArray = array(); 69 foreach( $assignedNodes as $node ) 70 { 71 $assignedNodeIDArray[] = $node->attribute( 'node_id' ); 72 } 73 eZContentObjectTreeNode::removeSubtrees( $assignedNodeIDArray, false ); 74 } 75 else 76 $object->purge(); 77 78 return true; 79 } 80 } 81 82 83 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |