eZ Publish  [4.0]
ezoperationhandler.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // Definition of eZOperationHandler class
00004 //
00005 // Created on: <06-Oct-2002 16:25:10 amos>
00006 //
00007 // ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00008 // SOFTWARE NAME: eZ Publish
00009 // SOFTWARE RELEASE: 4.0.x
00010 // COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
00011 // SOFTWARE LICENSE: GNU General Public License v2.0
00012 // NOTICE: >
00013 //   This program is free software; you can redistribute it and/or
00014 //   modify it under the terms of version 2.0  of the GNU General
00015 //   Public License as published by the Free Software Foundation.
00016 //
00017 //   This program is distributed in the hope that it will be useful,
00018 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //   GNU General Public License for more details.
00021 //
00022 //   You should have received a copy of version 2.0 of the GNU General
00023 //   Public License along with this program; if not, write to the Free
00024 //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00025 //   MA 02110-1301, USA.
00026 //
00027 //
00028 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
00029 //
00030 
00031 /*! \file ezoperationhandler.php
00032 */
00033 
00034 /*!
00035   \class eZOperationHandler ezoperationhandler.php
00036   \brief The class eZOperationHandler does
00037 
00038 */
00039 
00040 //include_once( 'lib/ezutils/classes/ezmoduleoperationinfo.php' );
00041 
00042 class eZOperationHandler
00043 {
00044     /*!
00045      Constructor
00046     */
00047     function eZOperationHandler()
00048     {
00049     }
00050 
00051     static function moduleOperationInfo( $moduleName, $useTriggers = true )
00052     {
00053         if ( !isset( $GLOBALS['eZGlobalModuleOperationList'] ) )
00054         {
00055             $GLOBALS['eZGlobalModuleOperationList'] = array();
00056         }
00057         if ( isset( $GLOBALS['eZGlobalModuleOperationList'][$moduleName] ) )
00058         {
00059             return $GLOBALS['eZGlobalModuleOperationList'][$moduleName];
00060         }
00061         $moduleOperationInfo = new eZModuleOperationInfo( $moduleName, $useTriggers );
00062         $moduleOperationInfo->loadDefinition();
00063         return $GLOBALS['eZGlobalModuleOperationList'][$moduleName] = $moduleOperationInfo;
00064     }
00065 
00066     static function execute( $moduleName, $operationName, $operationParameters, $lastTriggerName = null, $useTriggers = true )
00067     {
00068         $moduleOperationInfo = eZOperationHandler::moduleOperationInfo( $moduleName, $useTriggers );
00069         if ( !$moduleOperationInfo->isValid() )
00070         {
00071             eZDebug::writeError( "Cannot execute operation '$operationName' in module '$moduleName', no valid data",
00072                                   'eZOperationHandler::execute' );
00073             return null;
00074         }
00075         return $moduleOperationInfo->execute( $operationName, $operationParameters, $lastTriggerName, $useTriggers );
00076     }
00077 }
00078 
00079 ?>