class Asset extends AbstractElement (View source)

Traits

Properties

static array $types possible types of an asset
integer $id Unique ID
integer $parentId ID of the parent asset
Asset $parent
string $type Type
string $filename Name of the file
string $path Path of the file, without the filename, only the full path of the parent asset
string $mimetype Mime-Type of the file
integer $creationDate Timestamp of creation
integer $modificationDate Timestamp of modification
resource $stream
integer $userOwner ID of the owner user
integer $userModification ID of the user who make the latest changes
array $properties List of properties
array $versions List of versions
array $metadata
string $locked enum('self','propagate') nullable
array $customSettings List of some custom settings [key] => value Here there can be stored some data, eg. the video thumbnail files, .
bool $hasMetaData
Dependency $dependencies Dependencies of this asset
array $childs Contains the child elements
boolean $hasChilds Indicator if there are childs
array $siblings Contains a list of sibling documents
boolean $hasSiblings Indicator if document has siblings or not
array $scheduledTasks Contains all scheduled tasks

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

initDao(null $key = null, bool $forceDetection = false)

No description

$this
setValues(array $data = array())

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

mixed
__call($method, $args)

No description

void
__clone()

No description

array
getObjectVars()

returns object values without the dao

void
beginTransaction()

No description

void
commit()

No description

void
rollBack()

No description

void
configure()

No description

array
getValidTableColumns(string $table, bool $cache)

No description

void
resetValidTableColumnsCache(string $table)

No description

mixed
getProperty(string $name, bool $asContainer = false)

Get specific property data or the property object itself ($asContainer=true) by its name, if the property doesn't exists return null

bool
hasProperty($name)

No description

removeProperty($name)

No description

string
getCacheTag()

get the cache tag for the element

array
getCacheTags(array $tags = array())

Get the cache tags for the element, resolve all dependencies to tag the cache entries This is necessary to update the cache if there is a change in an depended object

array
resolveDependencies()

Resolves the dependencies of the element and returns an array of them - Used by update()

void
isLocked()

Returns true if the element is locked

array
getUserPermissions()

No description

boolean
isAllowed(string $type)

This is used for user-permissions, pass a permission type (eg. list, view, save) an you know if the current user is allowed to perform the requested action

unlockPropagate()

No description

boolean
hasNoChilds()

Inverted hasChilds()

string
__toString()

No description

mixed
getChilds() deprecated

No description

mixed
setChilds() deprecated

No description

mixed
hasChilds() deprecated

No description

static array
getTypes()

No description

getByPath(string $path)

Static helper to get an asset by the passed path

getById($id)

Static helper to get an asset by the passed ID

static Asset
create($parentId, $data = array(), $save = true)

Helper to quickly create a new asset

static mixed
getList(array $config = array())

No description

static total
getTotalCount(array $config = array())

No description

static int|string
getTypeFromMimeMapping($mimeType, $filename)

returns the asset type of a filename and mimetype

string
getFileSystemPath()

Get full path to the asset on the filesystem

$this
save()

No description

correctPath()

No description

null|Version
saveVersion(bool $setModificationDate = true, bool $callPluginHook = true)

No description

string
getFullPath()

Returns the full path of the document including the filename

string
getRealPath()

No description

string
getRealFullPath()

No description

array
getChildren()

No description

boolean
hasChildren()

No description

array
getSiblings()

Get a list of the sibling assets

bool
hasSiblings()

Returns true if the asset has at least one sibling

string
getLocked()

Returns true if the element is locked

void
setLocked(bool $locked)

No description

delete()

No description

clearDependentCache(array $additionalTags = array())

No description

getDependencies()

No description

integer
getCreationDate()

No description

integer
getId()

No description

string
getFilename()

No description

string
getKey()

Alias for getFilename()

integer
getModificationDate()

No description

integer
getParentId()

No description

string
getPath()

No description

string
getType()

No description

void
setCreationDate(integer $creationDate)

No description

$this
setId(integer $id)

No description

$this
setFilename(string $filename)

No description

void
setModificationDate(integer $modificationDate)

No description

$this
setParentId(integer $parentId)

No description

$this
setPath(string $path)

No description

$this
setType(string $type)

No description

mixed
getData()

No description

$this
setData(mixed $data)

No description

resource
getStream()

No description

$this
setStream($stream)

No description

null|string
getChecksum(string $type = 'md5')

No description

bool
getDataChanged()

No description

$this
setDataChanged(bool $changed = true)

No description

array
getProperties()

No description

$this
setProperties(array $properties)

No description

$this
setProperty($name, $type, $data, bool $inherited = false, bool $inheritable = false)

No description

integer
getUserOwner()

No description

integer
getUserModification()

No description

void
setUserOwner(integer $userOwner)

No description

void
setUserModification(integer $userModification)

No description

array
getVersions()

No description

$this
setVersions(array $versions)

No description

string
getTemporaryFile()

returns the path to a temp file

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

No description

null
getCustomSetting($key)

No description

removeCustomSetting($key)

No description

array
getCustomSettings()

No description

$this
setCustomSettings(array $customSettings)

No description

string
getMimetype()

No description

$this
setMimetype(string $mimetype)

No description

setMetadata(array $metadata)

No description

boolean
getHasMetaData()

No description

setHasMetaData(boolean $hasMetaData)

No description

addMetadata(string $name, string $type, null $data = null, null $language = null)

No description

array
getMetadata($name = null, $language = null)

No description

array
getScheduledTasks()

No description

$this
setScheduledTasks($scheduledTasks)

No description

saveScheduledTasks()

No description

string
getFileSize($format = 'noformatting', $precision = 2)

Get filesize

getParent()

No description

$this
setParent(Asset $parent)

No description

string
getImageThumbnailSavePath()

No description

string
getVideoThumbnailSavePath()

No description

__wakeup()

No description

removeInheritedProperties()

No description

renewInheritedProperties()

No description

__destruct()

No description

Details

at line line 30
Dao getDao()

Return Value

Dao

AbstractModel setDao($dao)

Parameters

$dao

Return Value

AbstractModel

AbstractDao getResource() deprecated

deprecated

Return Value

AbstractDao

initDao(null $key = null, bool $forceDetection = false)

Parameters

null $key
bool $forceDetection

Exceptions

Exception

$this setValues(array $data = array())

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

at line line 1765
array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

void __clone()

Return Value

void

array getObjectVars()

returns object values without the dao

Return Value

array

void beginTransaction()

Return Value

void

void commit()

Return Value

void

void rollBack()

Return Value

void

void configure()

Return Value

void

array getValidTableColumns(string $table, bool $cache)

Parameters

string $table
bool $cache

Return Value

array

void resetValidTableColumnsCache(string $table)

Parameters

string $table

Return Value

void

mixed getProperty(string $name, bool $asContainer = false)

Get specific property data or the property object itself ($asContainer=true) by its name, if the property doesn't exists return null

Parameters

string $name
bool $asContainer

Return Value

mixed

bool hasProperty($name)

Parameters

$name

Return Value

bool

removeProperty($name)

Parameters

$name

string getCacheTag()

get the cache tag for the element

Return Value

string

array getCacheTags(array $tags = array())

Get the cache tags for the element, resolve all dependencies to tag the cache entries This is necessary to update the cache if there is a change in an depended object

Parameters

array $tags

Return Value

array

array resolveDependencies()

Resolves the dependencies of the element and returns an array of them - Used by update()

Return Value

array

void isLocked()

Returns true if the element is locked

Return Value

void

array getUserPermissions()

Return Value

array

boolean isAllowed(string $type)

This is used for user-permissions, pass a permission type (eg. list, view, save) an you know if the current user is allowed to perform the requested action

Parameters

string $type

Return Value

boolean

unlockPropagate()

boolean hasNoChilds()

Inverted hasChilds()

Return Value

boolean

string __toString()

Return Value

string

mixed getChilds() deprecated

deprecated

Return Value

mixed

mixed setChilds() deprecated

deprecated

Return Value

mixed

mixed hasChilds() deprecated

deprecated

Return Value

mixed

at line line 210
static array getTypes()

Return Value

array

at line line 220
static Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video getByPath(string $path)

Static helper to get an asset by the passed path

Parameters

string $path

Return Value

Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video

at line line 244
static ElementInterface getById($id)

Static helper to get an asset by the passed ID

Parameters

$id

Return Value

ElementInterface $resource

at line line 296
static Asset create($parentId, $data = array(), $save = true)

Helper to quickly create a new asset

Parameters

$parentId
$data
$save

Return Value

Asset

at line line 356
static mixed getList(array $config = array())

Parameters

array $config

Return Value

mixed

Exceptions

Exception

at line line 372
static total getTotalCount(array $config = array())

Parameters

array $config

Return Value

total count

at line line 391
static int|string getTypeFromMimeMapping($mimeType, $filename)

returns the asset type of a filename and mimetype

Parameters

$mimeType
$filename

Return Value

int|string

at line line 435
string getFileSystemPath()

Get full path to the asset on the filesystem

Return Value

string

at line line 444
$this save()

Return Value

$this

Exceptions

Exception

at line line 540
correctPath()

Exceptions

Exception

at line line 739
null|Version saveVersion(bool $setModificationDate = true, bool $callPluginHook = true)

Parameters

bool $setModificationDate
bool $callPluginHook

Return Value

null|Version

Exceptions

Exception

at line line 789
string getFullPath()

Returns the full path of the document including the filename

Return Value

string

at line line 807
string getRealPath()

Return Value

string

at line line 815
string getRealFullPath()

Return Value

string

at line line 825
array getChildren()

Return Value

array

at line line 842
boolean hasChildren()

Return Value

boolean

at line line 864
array getSiblings()

Get a list of the sibling assets

Return Value

array

at line line 884
bool hasSiblings()

Returns true if the asset has at least one sibling

Return Value

bool

at line line 901
string getLocked()

Returns true if the element is locked

Return Value

string

at line line 910
void setLocked(bool $locked)

Parameters

bool $locked

Return Value

void

at line line 938
delete()

Exceptions

Exception

at line line 999
clearDependentCache(array $additionalTags = array())

Parameters

array $additionalTags

at line line 1015
Dependency getDependencies()

Return Value

Dependency

at line line 1027
integer getCreationDate()

Return Value

integer

at line line 1035
integer getId()

Return Value

integer $id

at line line 1043
string getFilename()

Return Value

string

at line line 1053
string getKey()

Alias for getFilename()

Return Value

string

at line line 1061
integer getModificationDate()

Return Value

integer

at line line 1069
integer getParentId()

Return Value

integer

at line line 1077
string getPath()

Return Value

string

at line line 1085
string getType()

Return Value

string

at line line 1094
void setCreationDate(integer $creationDate)

Parameters

integer $creationDate

Return Value

void

at line line 1105
$this setId(integer $id)

Parameters

integer $id

Return Value

$this

at line line 1116
$this setFilename(string $filename)

Parameters

string $filename

Return Value

$this

at line line 1127
void setModificationDate(integer $modificationDate)

Parameters

integer $modificationDate

Return Value

void

at line line 1138
$this setParentId(integer $parentId)

Parameters

integer $parentId

Return Value

$this

at line line 1150
$this setPath(string $path)

Parameters

string $path

Return Value

$this

at line line 1161
$this setType(string $type)

Parameters

string $type

Return Value

$this

at line line 1171
mixed getData()

Return Value

mixed

at line line 1185
$this setData(mixed $data)

Parameters

mixed $data

Return Value

$this

at line line 1198
resource getStream()

Return Value

resource

at line line 1221
$this setStream($stream)

Parameters

$stream

Return Value

$this

at line line 1254
null|string getChecksum(string $type = 'md5')

Parameters

string $type

Return Value

null|string

Exceptions

Exception

at line line 1273
bool getDataChanged()

Return Value

bool

at line line 1282
$this setDataChanged(bool $changed = true)

Parameters

bool $changed

Return Value

$this

at line line 1293
array getProperties()

Return Value

array

at line line 1316
$this setProperties(array $properties)

Parameters

array $properties

Return Value

$this

at line line 1331
$this setProperty($name, $type, $data, bool $inherited = false, bool $inheritable = false)

Parameters

$name
$type
$data
bool $inherited
bool $inheritable

Return Value

$this

at line line 1352
integer getUserOwner()

Return Value

integer

at line line 1360
integer getUserModification()

Return Value

integer

at line line 1369
void setUserOwner(integer $userOwner)

Parameters

integer $userOwner

Return Value

void

at line line 1380
void setUserModification(integer $userModification)

Parameters

integer $userModification

Return Value

void

at line line 1390
array getVersions()

Return Value

array

at line line 1403
$this setVersions(array $versions)

Parameters

array $versions

Return Value

$this

at line line 1414
string getTemporaryFile()

returns the path to a temp file

Return Value

string

at line line 1436
$this setCustomSetting(string $key, mixed $value)

Parameters

string $key
mixed $value

Return Value

$this

at line line 1447
null getCustomSetting($key)

Parameters

$key

Return Value

null

at line line 1459
removeCustomSetting($key)

Parameters

$key

at line line 1469
array getCustomSettings()

Return Value

array

at line line 1478
$this setCustomSettings(array $customSettings)

Parameters

array $customSettings

Return Value

$this

at line line 1500
string getMimetype()

Return Value

string

at line line 1509
$this setMimetype(string $mimetype)

Parameters

string $mimetype

Return Value

$this

at line line 1519
setMetadata(array $metadata)

Parameters

array $metadata

at line line 1531
boolean getHasMetaData()

Return Value

boolean

at line line 1539
setHasMetaData(boolean $hasMetaData)

Parameters

boolean $hasMetaData

at line line 1550
addMetadata(string $name, string $type, null $data = null, null $language = null)

Parameters

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

at line line 1578
array getMetadata($name = null, $language = null)

Parameters

$name
$language

Return Value

array

at line line 1629
array getScheduledTasks()

Return Value

array

at line line 1644
$this setScheduledTasks($scheduledTasks)

Parameters

$scheduledTasks

Return Value

$this

at line line 1654
saveScheduledTasks()

at line line 1676
string getFileSize($format = 'noformatting', $precision = 2)

Get filesize

Parameters

$format
$precision

Return Value

string

at line line 1714
Asset getParent()

Return Value

Asset

at line line 1727
$this setParent(Asset $parent)

Parameters

Asset $parent

Return Value

$this

at line line 1740
string getImageThumbnailSavePath()

Return Value

string

at line line 1752
string getVideoThumbnailSavePath()

Return Value

string

at line line 1793
__wakeup()

at line line 1816
removeInheritedProperties()

at line line 1834
renewInheritedProperties()

at line line 1849
__destruct()