Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcontentclassoperations.php
Go to the documentation of this file.
1 <?php
19 class eZContentClassOperations
20 {
25 static function remove( $classID )
26 {
27 $contentClass = eZContentClass::fetch( $classID );
28
29 if ( $contentClass == null or !$contentClass->isRemovable() )
30 return false;
31
32 // Remove all objects
33 $contentObjects = eZContentObject::fetchSameClassList( $classID );
34 foreach ( $contentObjects as $contentObject )
35 {
36 eZContentObjectOperations::remove( $contentObject->attribute( 'id' ) );
37 }
38
39 if ( count( $contentObjects ) == 0 )
40 eZContentObject::expireAllViewCache();
41
42 eZContentClassClassGroup::removeClassMembers( $classID, 0 );
43 eZContentClassClassGroup::removeClassMembers( $classID, 1 );
44
45 // Fetch real version and remove it
46 $contentClass->remove( true );
47
48 // Fetch temp version and remove it
49 $tempDeleteClass = eZContentClass::fetch( $classID, true, 1 );
50 if ( $tempDeleteClass != null )
51 $tempDeleteClass->remove( true, 1 );
52
53 return true;
54 }
55 }
56
57
58 ?>
eZContentClassClassGroup\removeClassMembers
static removeClassMembers( $contentclass_id, $contentclass_version)
Definition: ezcontentclassclassgroup.php:112
eZContentClassOperations
The class eZContentClassOperations is a place where content class operations are encapsulated....
Definition: ezcontentclassoperations.php:20
eZContentClass\fetch
static fetch( $id, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
Definition: ezcontentclass.php:1116
eZContentObjectOperations\remove
static remove( $objectID, $removeSubtrees=true)
Definition: ezcontentobjectoperations.php:25
eZContentObject\fetchSameClassList
static fetchSameClassList( $contentClassID, $asObject=true, $offset=false, $limit=false)
Definition: ezcontentobject.php:1247
eZContentObject\expireAllViewCache
static expireAllViewCache()
Definition: ezcontentobject.php:5932
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.