[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/classes/ -> ezcontentclassoperations.php (source)

   1  <?php
   2  //
   3  // Definition of eZContentClassOperations class
   4  //
   5  // Created on: <23-Jan-2006 13:25:46 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 ezcontentclassoperations.php
  30  */
  31  
  32  /*!
  33    \class eZContentClassOperations ezcontentclassoperations.php
  34    \brief The class eZContentClassOperations is a place where
  35           content class operations are encapsulated.
  36    We move them out from eZContentClass because they may content code
  37    which is not directly related to content classes (e.g. clearing caches, etc).
  38  */
  39  
  40  include_once ( 'kernel/classes/ezcontentclass.php' );
  41  
  42  class eZContentClassOperations
  43  {
  44      /*!
  45       Removes content class and all data associated with it.
  46       \static
  47      */
  48      function remove( $classID )
  49      {
  50          $contentClass = eZContentClass::fetch( $classID );
  51  
  52          if ( $contentClass == null or !$contentClass->isRemovable() )
  53              return false;
  54  
  55          // Remove all objects
  56          $contentObjects = eZContentObject::fetchSameClassList( $classID );
  57          include_once ( 'kernel/classes/ezcontentobjectoperations.php' );
  58          foreach ( $contentObjects as $contentObject )
  59          {
  60              eZContentObjectOperations::remove( $contentObject->attribute( 'id' ) );
  61          }
  62  
  63          if ( count( $contentObjects ) == 0 )
  64              eZContentObject::expireAllViewCache();
  65  
  66          eZContentClassClassGroup::removeClassMembers( $classID, 0 );
  67          eZContentClassClassGroup::removeClassMembers( $classID, 1 );
  68  
  69          // Fetch real version and remove it
  70          $contentClass->remove( true );
  71  
  72          // Fetch temp version and remove it
  73          $tempDeleteClass = eZContentClass::fetch( $classID, true, 1 );
  74          if ( $tempDeleteClass != null )
  75              $tempDeleteClass->remove( true, 1 );
  76  
  77          return true;
  78      }
  79  }
  80  
  81  
  82  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7