class Document extends Asset (View source)

Traits

Properties

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

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

from Asset
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

from Asset
getByPath(string $path)

Static helper to get an asset by the passed path

from Asset
getById($id)

Static helper to get an asset by the passed ID

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

Helper to quickly create a new asset

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

No description

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

No description

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

returns the asset type of a filename and mimetype

from Asset
string
getFileSystemPath()

Get full path to the asset on the filesystem

from Asset
$this
save()

No description

from Asset
correctPath()

No description

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

No description

from Asset
string
getFullPath()

Returns the full path of the document including the filename

from Asset
string
getRealPath()

No description

from Asset
string
getRealFullPath()

No description

from Asset
array
getChildren()

No description

from Asset
boolean
hasChildren()

No description

from Asset
array
getSiblings()

Get a list of the sibling assets

from Asset
bool
hasSiblings()

Returns true if the asset has at least one sibling

from Asset
string
getLocked()

Returns true if the element is locked

from Asset
void
setLocked(bool $locked)

No description

from Asset
delete()

No description

from Asset
clearDependentCache(array $additionalTags = array())

No description

from Asset
getDependencies()

No description

from Asset
integer
getCreationDate()

No description

from Asset
integer
getId()

No description

from Asset
string
getFilename()

No description

from Asset
string
getKey()

Alias for getFilename()

from Asset
integer
getModificationDate()

No description

from Asset
integer
getParentId()

No description

from Asset
string
getPath()

No description

from Asset
string
getType()

No description

from Asset
void
setCreationDate(integer $creationDate)

No description

from Asset
$this
setId(integer $id)

No description

from Asset
$this
setFilename(string $filename)

No description

from Asset
void
setModificationDate(integer $modificationDate)

No description

from Asset
$this
setParentId(integer $parentId)

No description

from Asset
$this
setPath(string $path)

No description

from Asset
$this
setType(string $type)

No description

from Asset
mixed
getData()

No description

from Asset
$this
setData(mixed $data)

No description

from Asset
resource
getStream()

No description

from Asset
$this
setStream($stream)

No description

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

No description

from Asset
bool
getDataChanged()

No description

from Asset
$this
setDataChanged(bool $changed = true)

No description

from Asset
array
getProperties()

No description

from Asset
$this
setProperties(array $properties)

No description

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

No description

from Asset
integer
getUserOwner()

No description

from Asset
integer
getUserModification()

No description

from Asset
void
setUserOwner(integer $userOwner)

No description

from Asset
void
setUserModification(integer $userModification)

No description

from Asset
array
getVersions()

No description

from Asset
$this
setVersions(array $versions)

No description

from Asset
string
getTemporaryFile()

returns the path to a temp file

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

No description

from Asset
null
getCustomSetting($key)

No description

from Asset
removeCustomSetting($key)

No description

from Asset
array
getCustomSettings()

No description

from Asset
$this
setCustomSettings(array $customSettings)

No description

from Asset
string
getMimetype()

No description

from Asset
$this
setMimetype(string $mimetype)

No description

from Asset
setMetadata(array $metadata)

No description

from Asset
boolean
getHasMetaData()

No description

from Asset
setHasMetaData(boolean $hasMetaData)

No description

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

No description

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

No description

from Asset
array
getScheduledTasks()

No description

from Asset
$this
setScheduledTasks($scheduledTasks)

No description

from Asset
saveScheduledTasks()

No description

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

Get filesize

from Asset
getParent()

No description

from Asset
$this
setParent(Asset $parent)

No description

from Asset
string
getImageThumbnailSavePath()

No description

from Asset
string
getVideoThumbnailSavePath()

No description

from Asset
__wakeup()

No description

from Asset
removeInheritedProperties()

No description

from Asset
renewInheritedProperties()

No description

from Asset
__destruct()

No description

from Asset
getPageCount()

No description

mixed|string
getImageThumbnail($thumbnailName, int $page = 1, bool $deferred = false)

No description

getText($page = null)

No description

void
clearThumbnails($force = false)

No description

Details

at line line 27
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

in Asset 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

in Asset at line line 210
static array getTypes()

Return Value

array

in Asset 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

in Asset at line line 244
static ElementInterface getById($id)

Static helper to get an asset by the passed ID

Parameters

$id

Return Value

ElementInterface $resource

in Asset 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

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

Parameters

array $config

Return Value

mixed

Exceptions

Exception

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

Parameters

array $config

Return Value

total count

in Asset 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

in Asset at line line 435
string getFileSystemPath()

Get full path to the asset on the filesystem

Return Value

string

in Asset at line line 444
$this save()

Return Value

$this

Exceptions

Exception

in Asset at line line 540
correctPath()

Exceptions

Exception

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

Parameters

bool $setModificationDate
bool $callPluginHook

Return Value

null|Version

Exceptions

Exception

in Asset at line line 789
string getFullPath()

Returns the full path of the document including the filename

Return Value

string

in Asset at line line 807
string getRealPath()

Return Value

string

in Asset at line line 815
string getRealFullPath()

Return Value

string

in Asset at line line 825
array getChildren()

Return Value

array

in Asset at line line 842
boolean hasChildren()

Return Value

boolean

in Asset at line line 864
array getSiblings()

Get a list of the sibling assets

Return Value

array

in Asset at line line 884
bool hasSiblings()

Returns true if the asset has at least one sibling

Return Value

bool

in Asset at line line 901
string getLocked()

Returns true if the element is locked

Return Value

string

in Asset at line line 910
void setLocked(bool $locked)

Parameters

bool $locked

Return Value

void

in Asset at line line 938
delete()

Exceptions

Exception

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

Parameters

array $additionalTags

in Asset at line line 1015
Dependency getDependencies()

Return Value

Dependency

in Asset at line line 1027
integer getCreationDate()

Return Value

integer

in Asset at line line 1035
integer getId()

Return Value

integer $id

in Asset at line line 1043
string getFilename()

Return Value

string

in Asset at line line 1053
string getKey()

Alias for getFilename()

Return Value

string

in Asset at line line 1061
integer getModificationDate()

Return Value

integer

in Asset at line line 1069
integer getParentId()

Return Value

integer

in Asset at line line 1077
string getPath()

Return Value

string

in Asset at line line 1085
string getType()

Return Value

string

in Asset at line line 1094
void setCreationDate(integer $creationDate)

Parameters

integer $creationDate

Return Value

void

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

Parameters

integer $id

Return Value

$this

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

Parameters

string $filename

Return Value

$this

in Asset at line line 1127
void setModificationDate(integer $modificationDate)

Parameters

integer $modificationDate

Return Value

void

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

Parameters

integer $parentId

Return Value

$this

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

Parameters

string $path

Return Value

$this

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

Parameters

string $type

Return Value

$this

in Asset at line line 1171
mixed getData()

Return Value

mixed

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

Parameters

mixed $data

Return Value

$this

in Asset at line line 1198
resource getStream()

Return Value

resource

in Asset at line line 1221
$this setStream($stream)

Parameters

$stream

Return Value

$this

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

Parameters

string $type

Return Value

null|string

Exceptions

Exception

in Asset at line line 1273
bool getDataChanged()

Return Value

bool

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

Parameters

bool $changed

Return Value

$this

in Asset at line line 1293
array getProperties()

Return Value

array

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

Parameters

array $properties

Return Value

$this

in Asset 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

in Asset at line line 1352
integer getUserOwner()

Return Value

integer

in Asset at line line 1360
integer getUserModification()

Return Value

integer

in Asset at line line 1369
void setUserOwner(integer $userOwner)

Parameters

integer $userOwner

Return Value

void

in Asset at line line 1380
void setUserModification(integer $userModification)

Parameters

integer $userModification

Return Value

void

in Asset at line line 1390
array getVersions()

Return Value

array

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

Parameters

array $versions

Return Value

$this

in Asset at line line 1414
string getTemporaryFile()

returns the path to a temp file

Return Value

string

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

Parameters

string $key
mixed $value

Return Value

$this

in Asset at line line 1447
null getCustomSetting($key)

Parameters

$key

Return Value

null

in Asset at line line 1459
removeCustomSetting($key)

Parameters

$key

in Asset at line line 1469
array getCustomSettings()

Return Value

array

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

Parameters

array $customSettings

Return Value

$this

in Asset at line line 1500
string getMimetype()

Return Value

string

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

Parameters

string $mimetype

Return Value

$this

in Asset at line line 1519
setMetadata(array $metadata)

Parameters

array $metadata

in Asset at line line 1531
boolean getHasMetaData()

Return Value

boolean

in Asset at line line 1539
setHasMetaData(boolean $hasMetaData)

Parameters

boolean $hasMetaData

in Asset 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

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

Parameters

$name
$language

Return Value

array

in Asset at line line 1629
array getScheduledTasks()

Return Value

array

in Asset at line line 1644
$this setScheduledTasks($scheduledTasks)

Parameters

$scheduledTasks

Return Value

$this

in Asset at line line 1654
saveScheduledTasks()

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

Get filesize

Parameters

$format
$precision

Return Value

string

in Asset at line line 1714
Asset getParent()

Return Value

Asset

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

Parameters

Asset $parent

Return Value

$this

in Asset at line line 1740
string getImageThumbnailSavePath()

Return Value

string

in Asset at line line 1752
string getVideoThumbnailSavePath()

Return Value

string

in Asset at line line 1793
__wakeup()

in Asset at line line 1816
removeInheritedProperties()

in Asset at line line 1834
renewInheritedProperties()

in Asset at line line 1849
__destruct()

at line line 84
getPageCount()

at line line 99
mixed|string getImageThumbnail($thumbnailName, int $page = 1, bool $deferred = false)

Parameters

$thumbnailName
int $page
bool $deferred $deferred deferred means that the image will be generated on-the-fly (details see below)

Return Value

mixed|string

at line line 110
getText($page = null)

Parameters

$page

at line line 131
void clearThumbnails($force = false)

Parameters

$force

Return Value

void