extension/ezjscore/classes/ajaxuploader/ezprelationlistajaxuploader.php
public function createObject( $file, $parentNodeId, $name = '' )
    {
        $result = array();
        $parentNode = eZContentObjectTreeNode::fetch( $parentNodeId );
        if ( !$parentNode instanceof eZContentObjectTreeNode )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Location not found.'
                )
            );
        }

        $upload = new eZContentUpload();
        $r = $upload->handleLocalFile(
            $result, $file, $parentNodeId, null, $name,
            $this->attribute->attribute( 'language_code' )
        );
        if ( !$r || !$result['contentobject'] instanceof eZContentObject )
        {
            throw new RuntimeException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader',
                    'Unable to create the content object to add to the relation: %detail',
                    null, array( '%detail' => $result['errors'][0]['description'] )
                )
            );
        }
        return $result['contentobject'];
    }
public function createObject( $file, $parentNodeId, $name = '' )
    {
        $result = array();
        $parentNode = eZContentObjectTreeNode::fetch( $parentNodeId );
        if ( !$parentNode instanceof eZContentObjectTreeNode )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Location not found.'
                )
            );
        }

        $upload = new eZContentUpload();
        $r = $upload->handleLocalFile(
            $result, $file, $parentNodeId, null, $name,
            $this->attribute->attribute( 'language_code' )
        );
        if ( !$r || !$result['contentobject'] instanceof eZContentObject )
        {
            throw new RuntimeException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader',
                    'Unable to create the content object to add to the relation: %detail',
                    null, array( '%detail' => $result['errors'][0]['description'] )
                )
            );
        }
        return $result['contentobject'];
    }
public function createObject ( $ file , $ parentNodeId , $ name = '' ) { $ result = array ( ) ; $ parentNode = eZContentObjectTreeNode :: fetch ( $ parentNodeId ) ; if ( ! $ parentNode instanceof eZContentObjectTreeNode ) { throw new InvalidArgumentException ( ezpI18n :: tr ( 'extension/ezjscore/ajaxuploader' , 'Location not found.' ) ) ; } $ upload = new eZContentUpload ( ) ; $ r = $ upload -> handleLocalFile ( $ result , $ file , $ parentNodeId , null , $ name , $ this -> attribute -> attribute ( 'language_code' ) ) ; if ( ! $ r || ! $ result [ 'contentobject' ] instanceof eZContentObject ) { throw new RuntimeException ( ezpI18n :: tr ( 'extension/ezjscore/ajaxuploader' , 'Unable to create the content object to add to the relation: %detail' , null , array ( '%detail' => $ result [ 'errors' ] [ 0 ] [ 'description' ] ) ) ) ; } return $ result [ 'contentobject' ] ; }
Creates the eZContentObject from the uploaded file

@param eZHTTPFile $file
@param eZContentObjectTreeNode $location
@param string $name
@return eZContentObject
@throw InvalidArgumentException if the parent location does not exists
@throw RuntimeException if the object can not be created
Creates the eZContentObject from the uploaded file