datatypes/ngclasslist/ngclasslisttype.php
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $classList = $http->postVariable( $base . self::CLASS_LIST_VARIABLE . $contentObjectAttribute->attribute( "id" ), array() );
        $classList = !is_array( $classList ) ? array() : $classList;

        if ( empty( $classList ) && $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( "kernel/classes/datatypes", "Input required." ) );
            return eZInputValidator::STATE_INVALID;
        }

        $invalidClassIdentifiers = array();

        foreach ( $classList as $classIdentifier )
        {
            if ( !eZContentClass::exists( $classIdentifier, eZContentClass::VERSION_STATUS_DEFINED, false, true ) )
            {
                $invalidClassIdentifiers[] = $classIdentifier;
            }
        }

        if ( !empty( $invalidClassIdentifiers ) )
        {
            if ( count( $invalidClassIdentifiers ) == 1 )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( "extension/ngclasslist/datatypes", "Class with identifier '%identifier%' does not exist", null, array( "%identifier%" => $invalidClassIdentifiers[0] ) ) );
            }
            else
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( "extension/ngclasslist/datatypes", "Classes with '%identifiers%' identifiers do not exist", null, array( "%identifiers%" => implode( ", ", $invalidClassIdentifiers ) ) ) );
            }

            return eZInputValidator::STATE_INVALID;
        }

        return eZInputValidator::STATE_ACCEPTED;
    }
function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
    {
        $classList = $http->postVariable( $base . self::CLASS_LIST_VARIABLE . $contentObjectAttribute->attribute( "id" ), array() );
        $classList = !is_array( $classList ) ? array() : $classList;

        if ( empty( $classList ) && $contentObjectAttribute->validateIsRequired() )
        {
            $contentObjectAttribute->setValidationError( ezpI18n::tr( "kernel/classes/datatypes", "Input required." ) );
            return eZInputValidator::STATE_INVALID;
        }

        $invalidClassIdentifiers = array();

        foreach ( $classList as $classIdentifier )
        {
            if ( !eZContentClass::exists( $classIdentifier, eZContentClass::VERSION_STATUS_DEFINED, false, true ) )
            {
                $invalidClassIdentifiers[] = $classIdentifier;
            }
        }

        if ( !empty( $invalidClassIdentifiers ) )
        {
            if ( count( $invalidClassIdentifiers ) == 1 )
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( "extension/ngclasslist/datatypes", "Class with identifier '%identifier%' does not exist", null, array( "%identifier%" => $invalidClassIdentifiers[0] ) ) );
            }
            else
            {
                $contentObjectAttribute->setValidationError( ezpI18n::tr( "extension/ngclasslist/datatypes", "Classes with '%identifiers%' identifiers do not exist", null, array( "%identifiers%" => implode( ", ", $invalidClassIdentifiers ) ) ) );
            }

            return eZInputValidator::STATE_INVALID;
        }

        return eZInputValidator::STATE_ACCEPTED;
    }
function validateObjectAttributeHTTPInput ( $ http , $ base , $ contentObjectAttribute ) { $ classList = $ http -> postVariable ( $ base . self :: CLASS_LIST_VARIABLE . $ contentObjectAttribute -> attribute ( "id" ) , array ( ) ) ; $ classList = ! is_array ( $ classList ) ? array ( ) : $ classList ; if ( empty ( $ classList ) && $ contentObjectAttribute -> validateIsRequired ( ) ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( "kernel/classes/datatypes" , "Input required." ) ) ; return eZInputValidator :: STATE_INVALID ; } $ invalidClassIdentifiers = array ( ) ; foreach ( $ classList as $ classIdentifier ) { if ( ! eZContentClass :: exists ( $ classIdentifier , eZContentClass :: VERSION_STATUS_DEFINED , false , true ) ) { $ invalidClassIdentifiers [ ] = $ classIdentifier ; } } if ( ! empty ( $ invalidClassIdentifiers ) ) { if ( count ( $ invalidClassIdentifiers ) == 1 ) { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( "extension/ngclasslist/datatypes" , "Class with identifier '%identifier%' does not exist" , null , array ( "%identifier%" => $ invalidClassIdentifiers [ 0 ] ) ) ) ; } else { $ contentObjectAttribute -> setValidationError ( ezpI18n :: tr ( "extension/ngclasslist/datatypes" , "Classes with '%identifiers%' identifiers do not exist" , null , array ( "%identifiers%" => implode ( ", " , $ invalidClassIdentifiers ) ) ) ) ; } return eZInputValidator :: STATE_INVALID ; } return eZInputValidator :: STATE_ACCEPTED ; }
Validates the input and returns the validity status code

@param eZHTTPTool $http
@param string $base
@param eZContentObjectAttribute $contentObjectAttribute

@return int
Validates the input and returns the validity status code