Class

eZContentUpload

class eZContentUpload

Constants

STATUS_PERMISSION_DENIED

Properties

$Parameters

Methods

__construct(bool $params = false)

Initializes the object with the session data if they are found.

attributes()

hasAttribute($attributeName)

attribute($attributeName)

boolean handleLocalFile(array $result, string $filePath, mixed $location, eZContentObjectTreeNode|false $existingNode, string $nameString = '', string|false $localeCode = false)

Fetches the local file, figures out its MIME-type and creates the proper content object out of it.

boolean handleUpload(array $result, string $httpFileIdentifier, mixed $location, eZContentObjectTreeNode|false $existingNode, string $nameString = '', string|false $localeCode = false, boolean $publish = true)

Fetches the uploaded file, figures out its MIME-type and creates the proper content object out of it.

publishObject($result, $errors, $notices, $object, $publishVersion, $class, $parentNodes, $parentMainNode)

objectFileInfo($contentObject)

bool fetchHTTPFile($httpFileIdentifier, $errors, $file, $mimeData)

Fetches the HTTP-File into $file and fills in MIME-Type information into $mimeData.

findHTTPFileAttribute($dataMap, $fileAttribute)

findRegularFileAttribute($dataMap, $fileAttribute)

findStringAttribute($dataMap, $nameAttribute)

detectClassIdentifier($mime)

detectLocations($classIdentifier, $class, $location, $parentNodes, $parentMainNode)

checkAccess($nodeID, $class)

processNamePattern($variables, $namePattern)

nodeAliasID($nodeName)

setResult($result)

cleanupAll()

findHandler($result, $mimeInfo)

Details

at line 59
public __construct(bool $params = false)

Initializes the object with the session data if they are found.

If $params is supplied it is used instead.

Parameters

bool $params

at line 77
public attributes()

at line 85
public hasAttribute($attributeName)

Parameters

$attributeName

at line 93
public attribute($attributeName)

Parameters

$attributeName

at line 219
public boolean handleLocalFile(array $result, string $filePath, mixed $location, eZContentObjectTreeNode|false $existingNode, string $nameString = '', string|false $localeCode = false)

Fetches the local file, figures out its MIME-type and creates the proper content object out of it.

Parameters

array $result Result data, will be filled with information which the client can examine, contains: errors An array with errors, each element is an array with a 'description' entry containing the text
string $filePath Path to file which should be stored
mixed $location The node ID which the new object will be placed or the string 'auto' for automatic placement of type.
eZContentObjectTreeNode|false $existingNode Pass a contentobjecttreenode object to let the uploading be done to an existing object, if not it will create one from scratch.
string $nameString The name of the new object/new version
string|false $localeCode Locale code (eg eng-GB, fre-FR, ...) to use when creating the object or the version.

Return Value

boolean

at line 471
public boolean handleUpload(array $result, string $httpFileIdentifier, mixed $location, eZContentObjectTreeNode|false $existingNode, string $nameString = '', string|false $localeCode = false, boolean $publish = true)

Fetches the uploaded file, figures out its MIME-type and creates the proper content object out of it.

Parameters

array $result Result data, will be filled with information which the client can examine, contains: errors An array with errors, each element is an array with a 'description' entry containing the text
string $httpFileIdentifier The HTTP identifier of the uploaded file, this must match the name of the input tag.
mixed $location The node ID which the new object will be placed or the string 'auto' for automatic placement of type.
eZContentObjectTreeNode|false $existingNode Pass a contentobjecttreenode object to let the uploading be done to an existing object, if not it will create one from scratch.
string $nameString The name of the new object/new version
string|false $localeCode Locale code (eg eng-GB, fre-FR, ...) to use when creating the object or the version.
boolean $publish whether to publish the new created content object

Return Value

boolean

at line 761
public publishObject($result, $errors, $notices, $object, $publishVersion, $class, $parentNodes, $parentMainNode)

Parameters

$result
$errors
$notices
$object
$publishVersion
$class
$parentNodes
$parentMainNode

at line 829
public objectFileInfo($contentObject)

Parameters

$contentObject

at line 864
public bool fetchHTTPFile($httpFileIdentifier, $errors, $file, $mimeData)

Fetches the HTTP-File into $file and fills in MIME-Type information into $mimeData.

Parameters

$httpFileIdentifier
$errors
$file
$mimeData

Return Value

bool false if something went wrong.

at line 911
public findHTTPFileAttribute($dataMap, $fileAttribute)

Parameters

$dataMap
$fileAttribute

at line 944
public findRegularFileAttribute($dataMap, $fileAttribute)

Parameters

$dataMap
$fileAttribute

at line 977
public findStringAttribute($dataMap, $nameAttribute)

Parameters

$dataMap
$nameAttribute

at line 1006
public detectClassIdentifier($mime)

Parameters

$mime

at line 1043
public detectLocations($classIdentifier, $class, $location, $parentNodes, $parentMainNode)

Parameters

$classIdentifier
$class
$location
$parentNodes
$parentMainNode

at line 1168
public checkAccess($nodeID, $class)

Parameters

$nodeID
$class

at line 1200
public processNamePattern($variables, $namePattern)

Parameters

$variables
$namePattern

at line 1251
public nodeAliasID($nodeName)

Parameters

$nodeName

at line 1296
public setResult($result)

Parameters

$result

at line 1343
public cleanupAll()

at line 1356
public findHandler($result, $mimeInfo)

Parameters

$result
$mimeInfo