lib/ezutils/classes/ezmoduleoperationinfo.php
function executeClassMethod( $includeFile, $className, $methodName,
                                 $operationParameterDefinitions, $operationParameters )
    {
        if ( !class_exists( $className ) )
        {
            include_once( $includeFile );

            if ( !class_exists( $className, false ) )
            {
                return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS,
                              'internal_error_class_name' => $className );
            }
        }
        $classObject = $this->objectForClass( $className );
        if ( $classObject === null )
        {
            return array( 'internal_error' => eZModuleOperationInfo::ERROR_CLASS_INSTANTIATE_FAILED,
                          'internal_error_class_name' => $className );
        }
        if ( !method_exists( $classObject, $methodName ) )
        {
            return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS_METHOD,
                          'internal_error_class_name' => $className,
                          'internal_error_class_method_name' => $methodName );
        }
        $parameterArray = array();

        foreach ( $operationParameterDefinitions as $operationParameterDefinition )
        {
            $parameterName = $operationParameterDefinition['name'];
            if ( isset( $operationParameterDefinition['constant'] ) )
            {
                $constantValue = $operationParameterDefinition['constant'];
                $parameterArray[] = $constantValue;
            }
            else if ( isset( $operationParameters[$parameterName] ) )
            {
                // Do type checking
                $parameterArray[] = $operationParameters[$parameterName];
            }
            else
            {
                if ( $operationParameterDefinition['required'] )
                {

                    return array( 'internal_error' => eZModuleOperationInfo::ERROR_MISSING_PARAMETER,
                                  'internal_error_parameter_name' => $parameterName );
                }
                else if ( isset( $operationParameterDefinition['default'] ) )
                {
                    $parameterArray[] = $operationParameterDefinition['default'];
                }
                else
                {
                    $parameterArray[] = null;
                }
            }
        }

        return call_user_func_array( array( $classObject, $methodName ), $parameterArray );
    }
function executeClassMethod( $includeFile, $className, $methodName,
                                 $operationParameterDefinitions, $operationParameters )
    {
        if ( !class_exists( $className ) )
        {
            include_once( $includeFile );

            if ( !class_exists( $className, false ) )
            {
                return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS,
                              'internal_error_class_name' => $className );
            }
        }
        $classObject = $this->objectForClass( $className );
        if ( $classObject === null )
        {
            return array( 'internal_error' => eZModuleOperationInfo::ERROR_CLASS_INSTANTIATE_FAILED,
                          'internal_error_class_name' => $className );
        }
        if ( !method_exists( $classObject, $methodName ) )
        {
            return array( 'internal_error' => eZModuleOperationInfo::ERROR_NO_CLASS_METHOD,
                          'internal_error_class_name' => $className,
                          'internal_error_class_method_name' => $methodName );
        }
        $parameterArray = array();

        foreach ( $operationParameterDefinitions as $operationParameterDefinition )
        {
            $parameterName = $operationParameterDefinition['name'];
            if ( isset( $operationParameterDefinition['constant'] ) )
            {
                $constantValue = $operationParameterDefinition['constant'];
                $parameterArray[] = $constantValue;
            }
            else if ( isset( $operationParameters[$parameterName] ) )
            {
                // Do type checking
                $parameterArray[] = $operationParameters[$parameterName];
            }
            else
            {
                if ( $operationParameterDefinition['required'] )
                {

                    return array( 'internal_error' => eZModuleOperationInfo::ERROR_MISSING_PARAMETER,
                                  'internal_error_parameter_name' => $parameterName );
                }
                else if ( isset( $operationParameterDefinition['default'] ) )
                {
                    $parameterArray[] = $operationParameterDefinition['default'];
                }
                else
                {
                    $parameterArray[] = null;
                }
            }
        }

        return call_user_func_array( array( $classObject, $methodName ), $parameterArray );
    }
function executeClassMethod ( $ includeFile , $ className , $ methodName , $ operationParameterDefinitions , $ operationParameters ) { if ( ! class_exists ( $ className ) ) { include_once ( $ includeFile ) ; if ( ! class_exists ( $ className , false ) ) { return array ( 'internal_error' => eZModuleOperationInfo :: ERROR_NO_CLASS , 'internal_error_class_name' => $ className ) ; } } $ classObject = $ this -> objectForClass ( $ className ) ; if ( $ classObject === null ) { return array ( 'internal_error' => eZModuleOperationInfo :: ERROR_CLASS_INSTANTIATE_FAILED , 'internal_error_class_name' => $ className ) ; } if ( ! method_exists ( $ classObject , $ methodName ) ) { return array ( 'internal_error' => eZModuleOperationInfo :: ERROR_NO_CLASS_METHOD , 'internal_error_class_name' => $ className , 'internal_error_class_method_name' => $ methodName ) ; } $ parameterArray = array ( ) ; foreach ( $ operationParameterDefinitions as $ operationParameterDefinition ) { $ parameterName = $ operationParameterDefinition [ 'name' ] ; if ( isset ( $ operationParameterDefinition [ 'constant' ] ) ) { $ constantValue = $ operationParameterDefinition [ 'constant' ] ; $ parameterArray [ ] = $ constantValue ; } else if ( isset ( $ operationParameters [ $ parameterName ] ) ) { // Do type checking $ parameterArray [ ] = $ operationParameters [ $ parameterName ] ; } else { if ( $ operationParameterDefinition [ 'required' ] ) { return array ( 'internal_error' => eZModuleOperationInfo :: ERROR_MISSING_PARAMETER , 'internal_error_parameter_name' => $ parameterName ) ; } else if ( isset ( $ operationParameterDefinition [ 'default' ] ) ) { $ parameterArray [ ] = $ operationParameterDefinition [ 'default' ] ; } else { $ parameterArray [ ] = null ; } } } return call_user_func_array ( array ( $ classObject , $ methodName ) , $ parameterArray ) ; }
Executes a class method in an operation body

@param string $includeFile The file where the class & method are defined
@param string $className The class where the method is implemented
@param string $methodName The method to call
@param mixed $operationParameterDefinitions The method parameters definition
@param mixed $operationParameters The method parameters values
@return array
Executes a class method in an operation body