PHP Class Pimcore\Model\Asset

Inheritance: extends Pimcore\Model\Element\AbstractElement
Afficher le fichier Open project: pimcore/pimcore Class Usage Examples

Méthodes publiques

Свойство Type Description
$childs array Contains the child elements
$creationDate integer Timestamp of creation
$customSettings array .. of the asset, ...
$dependencies Dependency Dependencies of this asset
$filename string Name of the file
$hasChilds boolean Indicator if there are childs
$hasMetaData boolean
$hasSiblings boolean Indicator if document has siblings or not
$id integer Unique ID
$locked string enum('self','propagate') nullable
$metadata array
$mimetype string Mime-Type of the file
$modificationDate integer Timestamp of modification
$parent Asset
$parentId integer ID of the parent asset
$path string Path of the file, without the filename, only the full path of the parent asset
$properties array List of properties
$scheduledTasks array Contains all scheduled tasks
$siblings array Contains a list of sibling documents
$stream resource
$type string Type
$types array possible types of an asset
$userModification integer ID of the user who make the latest changes
$userOwner integer ID of the owner user
$versions array List of versions

Protected Properties

Свойство Type Description
$_dataChanged boolean Indicator if data has changed

Méthodes publiques

Méthode Description
__destruct ( )
__sleep ( )
__wakeup ( )
addMetadata ( string $name, string $type, null $data = null, null $language = null )
clearDependentCache ( array $additionalTags = [] )
correctPath ( )
create ( integer $parentId, array $data = [], $save = true ) : Asset Helper to quickly create a new asset
delete ( )
getById ( integer $id ) : Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video Static helper to get an asset by the passed ID
getByPath ( string $path ) : Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video Static helper to get an asset by the passed path
getChecksum ( string $type = "md5" ) : null | string
getChildren ( ) : array
getCreationDate ( ) : integer
getCustomSetting ( $key ) : null
getCustomSettings ( ) : array
getData ( ) : mixed
getDataChanged ( ) : boolean
getDependencies ( ) : Dependency
getFileSize ( string $format = 'noformatting', $precision = 2 ) : string Get filesize
getFileSystemPath ( ) : string Get full path to the asset on the filesystem
getFilename ( ) : string
getFullPath ( ) : string Returns the full path of the document including the filename
getHasMetaData ( ) : boolean
getId ( ) : integer
getImageThumbnailSavePath ( ) : string
getKey ( ) : string Alias for getFilename()
getList ( array $config = [] ) : mixed
getLocked ( ) : string Returns true if the element is locked
getMetadata ( $name = null, $language = null ) : array
getMimetype ( ) : string
getModificationDate ( ) : integer
getParent ( ) : Asset
getParentId ( ) : integer
getPath ( ) : string
getProperties ( ) : Property[]
getRealFullPath ( ) : string
getRealPath ( ) : string
getScheduledTasks ( ) : array
getSiblings ( ) : array Get a list of the sibling assets
getStream ( ) : resource
getTemporaryFile ( ) : string returns the path to a temp file
getTotalCount ( array $config = [] ) : total
getType ( ) : string
getTypeFromMimeMapping ( $mimeType, $filename ) : integer | string returns the asset type of a filename and mimetype
getTypes ( ) : array
getUserModification ( ) : integer
getUserOwner ( ) : integer
getVersions ( ) : array
getVideoThumbnailSavePath ( ) : string
hasChildren ( ) : boolean
hasSiblings ( ) : boolean Returns true if the asset has at least one sibling
removeCustomSetting ( $key )
removeInheritedProperties ( )
renewInheritedProperties ( )
save ( )
saveScheduledTasks ( )
saveVersion ( boolean $setModificationDate = true, boolean $callPluginHook = true ) : null | Version
setCreationDate ( integer $creationDate )
setCustomSetting ( string $key, mixed $value )
setCustomSettings ( array $customSettings )
setData ( mixed $data )
setDataChanged ( boolean $changed = true )
setFilename ( string $filename )
setHasMetaData ( boolean $hasMetaData )
setId ( integer $id )
setLocked ( $locked )
setMetadata ( array $metadata )
setMimetype ( string $mimetype )
setModificationDate ( integer $modificationDate )
setParent ( Asset $parent )
setParentId ( integer $parentId )
setPath ( string $path )
setProperties ( array $properties )
setProperty ( $name, $type, $data, boolean $inherited = false, boolean $inheritable = false )
setScheduledTasks ( $scheduledTasks )
setStream ( $stream )
setType ( string $type )
setUserModification ( integer $userModification )
setUserOwner ( integer $userOwner )
setVersions ( array $versions )

Méthodes protégées

Méthode Description
closeStream ( )
deletePhysicalFile ( ) Deletes file from filesystem
update ( )

Method Details

__destruct() public méthode

public __destruct ( )

__sleep() public méthode

public __sleep ( )

__wakeup() public méthode

public __wakeup ( )

addMetadata() public méthode

public addMetadata ( string $name, string $type, null $data = null, null $language = null )
$name string
$type string can be "folder", "image", "input", "audio", "video", "document", "archive" or "unknown"
$data null
$language null

clearDependentCache() public méthode

public clearDependentCache ( array $additionalTags = [] )
$additionalTags array

closeStream() protected méthode

protected closeStream ( )

correctPath() public méthode

public correctPath ( )

create() public static méthode

Helper to quickly create a new asset
public static create ( integer $parentId, array $data = [], $save = true ) : Asset
$parentId integer
$data array
Résultat Asset

delete() public méthode

public delete ( )

deletePhysicalFile() protected méthode

Deletes file from filesystem
protected deletePhysicalFile ( )

getById() public static méthode

Static helper to get an asset by the passed ID
public static getById ( integer $id ) : Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video
$id integer
Résultat Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video

getByPath() public static méthode

Static helper to get an asset by the passed path
public static getByPath ( string $path ) : Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video
$path string
Résultat Asset | Archive | Audio | Document | Folder | Image | Text | Unknown | Video

getChecksum() public méthode

public getChecksum ( string $type = "md5" ) : null | string
$type string
Résultat null | string

getChildren() public méthode

public getChildren ( ) : array
Résultat array

getCreationDate() public méthode

public getCreationDate ( ) : integer
Résultat integer

getCustomSetting() public méthode

public getCustomSetting ( $key ) : null
$key
Résultat null

getCustomSettings() public méthode

public getCustomSettings ( ) : array
Résultat array

getData() public méthode

public getData ( ) : mixed
Résultat mixed

getDataChanged() public méthode

public getDataChanged ( ) : boolean
Résultat boolean

getDependencies() public méthode

public getDependencies ( ) : Dependency
Résultat Dependency

getFileSize() public méthode

Get filesize
public getFileSize ( string $format = 'noformatting', $precision = 2 ) : string
$format string ('GB','MB','KB','B')
Résultat string

getFileSystemPath() public méthode

Get full path to the asset on the filesystem
public getFileSystemPath ( ) : string
Résultat string

getFilename() public méthode

public getFilename ( ) : string
Résultat string

getFullPath() public méthode

Returns the full path of the document including the filename
public getFullPath ( ) : string
Résultat string

getHasMetaData() public méthode

public getHasMetaData ( ) : boolean
Résultat boolean

getId() public méthode

public getId ( ) : integer
Résultat integer

getImageThumbnailSavePath() public méthode

public getImageThumbnailSavePath ( ) : string
Résultat string

getKey() public méthode

Alias for getFilename()
public getKey ( ) : string
Résultat string

getList() public static méthode

public static getList ( array $config = [] ) : mixed
$config array
Résultat mixed

getLocked() public méthode

Returns true if the element is locked
public getLocked ( ) : string
Résultat string

getMetadata() public méthode

public getMetadata ( $name = null, $language = null ) : array
Résultat array

getMimetype() public méthode

public getMimetype ( ) : string
Résultat string

getModificationDate() public méthode

public getModificationDate ( ) : integer
Résultat integer

getParent() public méthode

public getParent ( ) : Asset
Résultat Asset

getParentId() public méthode

public getParentId ( ) : integer
Résultat integer

getPath() public méthode

public getPath ( ) : string
Résultat string

getProperties() public méthode

public getProperties ( ) : Property[]
Résultat Property[]

getRealFullPath() public méthode

public getRealFullPath ( ) : string
Résultat string

getRealPath() public méthode

public getRealPath ( ) : string
Résultat string

getScheduledTasks() public méthode

public getScheduledTasks ( ) : array
Résultat array

getSiblings() public méthode

Get a list of the sibling assets
public getSiblings ( ) : array
Résultat array

getStream() public méthode

public getStream ( ) : resource
Résultat resource

getTemporaryFile() public méthode

returns the path to a temp file
public getTemporaryFile ( ) : string
Résultat string

getTotalCount() public static méthode

public static getTotalCount ( array $config = [] ) : total
$config array
Résultat total count

getType() public méthode

public getType ( ) : string
Résultat string

getTypeFromMimeMapping() public static méthode

returns the asset type of a filename and mimetype
public static getTypeFromMimeMapping ( $mimeType, $filename ) : integer | string
$mimeType
$filename
Résultat integer | string

getTypes() public static méthode

public static getTypes ( ) : array
Résultat array

getUserModification() public méthode

public getUserModification ( ) : integer
Résultat integer

getUserOwner() public méthode

public getUserOwner ( ) : integer
Résultat integer

getVersions() public méthode

public getVersions ( ) : array
Résultat array

getVideoThumbnailSavePath() public méthode

public getVideoThumbnailSavePath ( ) : string
Résultat string

hasChildren() public méthode

public hasChildren ( ) : boolean
Résultat boolean

hasSiblings() public méthode

Returns true if the asset has at least one sibling
public hasSiblings ( ) : boolean
Résultat boolean

removeCustomSetting() public méthode

public removeCustomSetting ( $key )
$key

removeInheritedProperties() public méthode

renewInheritedProperties() public méthode

save() public méthode

public save ( )

saveScheduledTasks() public méthode

public saveScheduledTasks ( )

saveVersion() public méthode

public saveVersion ( boolean $setModificationDate = true, boolean $callPluginHook = true ) : null | Version
$setModificationDate boolean
$callPluginHook boolean
Résultat null | Version

setCreationDate() public méthode

public setCreationDate ( integer $creationDate )
$creationDate integer

setCustomSetting() public méthode

public setCustomSetting ( string $key, mixed $value )
$key string
$value mixed

setCustomSettings() public méthode

public setCustomSettings ( array $customSettings )
$customSettings array

setData() public méthode

public setData ( mixed $data )
$data mixed

setDataChanged() public méthode

public setDataChanged ( boolean $changed = true )
$changed boolean

setFilename() public méthode

public setFilename ( string $filename )
$filename string

setHasMetaData() public méthode

public setHasMetaData ( boolean $hasMetaData )
$hasMetaData boolean

setId() public méthode

public setId ( integer $id )
$id integer

setLocked() public méthode

public setLocked ( $locked )
$locked

setMetadata() public méthode

public setMetadata ( array $metadata )
$metadata array

setMimetype() public méthode

public setMimetype ( string $mimetype )
$mimetype string

setModificationDate() public méthode

public setModificationDate ( integer $modificationDate )
$modificationDate integer

setParent() public méthode

public setParent ( Asset $parent )
$parent Asset

setParentId() public méthode

public setParentId ( integer $parentId )
$parentId integer

setPath() public méthode

public setPath ( string $path )
$path string

setProperties() public méthode

public setProperties ( array $properties )
$properties array

setProperty() public méthode

public setProperty ( $name, $type, $data, boolean $inherited = false, boolean $inheritable = false )
$name
$type
$data
$inherited boolean
$inheritable boolean

setScheduledTasks() public méthode

public setScheduledTasks ( $scheduledTasks )
$scheduledTasks

setStream() public méthode

public setStream ( $stream )
$stream

setType() public méthode

public setType ( string $type )
$type string

setUserModification() public méthode

public setUserModification ( integer $userModification )
$userModification integer

setUserOwner() public méthode

public setUserOwner ( integer $userOwner )
$userOwner integer

setVersions() public méthode

public setVersions ( array $versions )
$versions array

update() protected méthode

protected update ( )

Property Details

$_dataChanged protected_oe property

Indicator if data has changed
protected bool $_dataChanged
Résultat boolean

$childs public_oe property

Contains the child elements
public array $childs
Résultat array

$creationDate public_oe property

Timestamp of creation
public int $creationDate
Résultat integer

$customSettings public_oe property

.. of the asset, ...
public array $customSettings
Résultat array

$dependencies public_oe property

Dependencies of this asset
public Dependency,Pimcore\Model $dependencies
Résultat Dependency

$filename public_oe property

Name of the file
public string $filename
Résultat string

$hasChilds public_oe property

Indicator if there are childs
public bool $hasChilds
Résultat boolean

$hasMetaData public_oe property

public bool $hasMetaData
Résultat boolean

$hasSiblings public_oe property

Indicator if document has siblings or not
public bool $hasSiblings
Résultat boolean

$id public_oe property

Unique ID
public int $id
Résultat integer

$locked public_oe property

enum('self','propagate') nullable
public string $locked
Résultat string

$metadata public_oe property

public array $metadata
Résultat array

$mimetype public_oe property

Mime-Type of the file
public string $mimetype
Résultat string

$modificationDate public_oe property

Timestamp of modification
public int $modificationDate
Résultat integer

$parent public_oe property

public Asset,Pimcore\Model $parent
Résultat Asset

$parentId public_oe property

ID of the parent asset
public int $parentId
Résultat integer

$path public_oe property

Path of the file, without the filename, only the full path of the parent asset
public string $path
Résultat string

$properties public_oe property

List of properties
public array $properties
Résultat array

$scheduledTasks public_oe property

Contains all scheduled tasks
public array $scheduledTasks
Résultat array

$siblings public_oe property

Contains a list of sibling documents
public array $siblings
Résultat array

$stream public_oe property

public resource $stream
Résultat resource

$type public_oe property

Type
public string $type
Résultat string

$types public_oe static_oe property

possible types of an asset
public static array $types
Résultat array

$userModification public_oe property

ID of the user who make the latest changes
public int $userModification
Résultat integer

$userOwner public_oe property

ID of the owner user
public int $userOwner
Résultat integer

$versions public_oe property

List of versions
public array $versions
Résultat array