class Document extends Asset (View source)

Traits

Properties

protected AbstractDao $dao from AbstractModel
protected int $__dataVersionTimestamp from AbstractElement
static array $types possible types of an asset from Asset
int $id Unique ID from Asset
int $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
int $creationDate Timestamp of creation from Asset
int $modificationDate Timestamp of modification from Asset
resource $stream from Asset
int $userOwner ID of the owner user from Asset
int $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
bool $hasChilds Indicator if there are childs from Asset
array $siblings Contains a list of sibling documents from Asset
bool $hasSiblings Indicator if document has siblings or not from Asset
array $scheduledTasks Contains all scheduled tasks from Asset
protected bool $_dataChanged Indicator if data has changed from Asset

Methods

Dao
getDao()

No description

setDao($dao)

No description

getResource() deprecated

No description

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

No description

static string|null
locateDaoClass(string $modelClass)

No description

$this
setValues(array $data = [])

No description

$this
setValue($key, $value)

No description

array
__sleep()

No description

from Asset
mixed
__call($method, $args)

No description

__clone()

No description

array
getObjectVars()

returns object values without the dao

array
__debugInfo()

No description

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

updateModificationInfos()

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 = [])

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()

$this
isLocked()

Returns true if the element is locked

array
getUserPermissions()

No description

bool
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

validatePathLength()

No description

bool
hasNoChilds()

Inverted hasChilds()

string
__toString()

No description

int
__getDataVersionTimestamp()

No description

__setDataVersionTimestamp(int $_dataVersionTimestamp)

No description

bool
__isBasedOnLatestData()

No description

from Asset
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, bool $force = false)

Static helper to get an asset by the passed path

from Asset
getById($id, bool $force = false)

Static helper to get an asset by the passed ID

from Asset
static Asset
create(int $parentId, array $data = [], bool $save = true)

Helper to quickly create a new asset

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

No description

from Asset
static int
getTotalCount(array $config = [])

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
update(array $params = [])

No description

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

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
bool
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
$this
setLocked(bool $locked)

No description

from Asset
deletePhysicalFile()

Deletes file from filesystem

from Asset
delete()

No description

clearDependentCache(array $additionalTags = [])

No description

from Asset
getDependencies()

No description

from Asset
int
getCreationDate()

No description

from Asset
int
getId()

No description

from Asset
string
getFilename()

No description

from Asset
string
getKey()

Alias for getFilename()

from Asset
int
getModificationDate()

No description

from Asset
int
getParentId()

No description

from Asset
string
getPath()

No description

from Asset
string
getType()

No description

from Asset
$this
setCreationDate(int $creationDate)

No description

from Asset
$this
setId(int $id)

No description

from Asset
$this
setFilename(string $filename)

No description

from Asset
$this
setModificationDate(int $modificationDate)

No description

from Asset
$this
setParentId(int $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
closeStream()

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
int
getUserOwner()

No description

from Asset
int
getUserModification()

No description

from Asset
$this
setUserOwner(int $userOwner)

No description

from Asset
$this
setUserModification(int $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
bool
getHasMetaData()

No description

from Asset
setHasMetaData(bool $hasMetaData)

No description

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

No description

from Asset
array
getMetadata(null $name = null, 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(string $format = 'noformatting', int $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
int|null
readPageCount(null $path = null)

No description

int|null
getPageCount()

No description

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

No description

mixed|null
getText(null $page = null)

No description

clearThumbnails(bool $force = false)

No description

Details

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

static string|null locateDaoClass(string $modelClass)

Parameters

string $modelClass

Return Value

string|null

$this setValues(array $data = [])

Parameters

array $data

Return Value

$this

$this setValue($key, $value)

Parameters

$key
$value

Return Value

$this

array __sleep()

Return Value

array

mixed __call($method, $args)

Parameters

$method
$args

Return Value

mixed

Exceptions

Exception

__clone()

array getObjectVars()

returns object values without the dao

Return Value

array

array __debugInfo()

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

protected updateModificationInfos()

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 = [])

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

$this isLocked()

Returns true if the element is locked

Return Value

$this

array getUserPermissions()

Return Value

array

bool 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

bool

unlockPropagate()

protected validatePathLength()

bool hasNoChilds()

Inverted hasChilds()

Return Value

bool

string __toString()

Return Value

string

int __getDataVersionTimestamp()

Return Value

int

__setDataVersionTimestamp(int $_dataVersionTimestamp)

Parameters

int $_dataVersionTimestamp

bool __isBasedOnLatestData()

Return Value

bool

mixed getChilds() deprecated

deprecated

Return Value

mixed

mixed setChilds() deprecated

deprecated

Return Value

mixed

mixed hasChilds() deprecated

deprecated

Return Value

mixed

static array getTypes()

Return Value

array

static Asset|Archive|Audio|Document|Folder|Image|Text|Unknown|Video getByPath(string $path, bool $force = false)

Static helper to get an asset by the passed path

Parameters

string $path
bool $force

Return Value

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

static ElementInterface getById($id, bool $force = false)

Static helper to get an asset by the passed ID

Parameters

$id
bool $force

Return Value

ElementInterface $resource

static Asset create(int $parentId, array $data = [], bool $save = true)

Helper to quickly create a new asset

Parameters

int $parentId
array $data
bool $save

Return Value

Asset

static mixed getList(array $config = [])

Parameters

array $config

Return Value

mixed

Exceptions

Exception

static int getTotalCount(array $config = [])

Parameters

array $config

Return Value

int total count

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

returns the asset type of a filename and mimetype

Parameters

$mimeType
$filename

Return Value

int|string

string getFileSystemPath()

Get full path to the asset on the filesystem

Return Value

string

$this save()

Return Value

$this

Exceptions

Exception

correctPath()

Exceptions

Exception

protected update(array $params = [])

Parameters

array $params additional parameters (e.g. "versionNote" for the version note)

Exceptions

Exception

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

Parameters

bool $setModificationDate
bool $callPluginHook
string $versionNote version note

Return Value

null|Version

Exceptions

Exception

string getFullPath()

Returns the full path of the document including the filename

Return Value

string

string getRealPath()

Return Value

string

string getRealFullPath()

Return Value

string

array getChildren()

Return Value

array

bool hasChildren()

Return Value

bool

array getSiblings()

Get a list of the sibling assets

Return Value

array

bool hasSiblings()

Returns true if the asset has at least one sibling

Return Value

bool

string getLocked()

Returns true if the element is locked

Return Value

string

$this setLocked(bool $locked)

Parameters

bool $locked

Return Value

$this

protected deletePhysicalFile()

Deletes file from filesystem

delete()

Exceptions

Exception

clearDependentCache(array $additionalTags = [])

Parameters

array $additionalTags

Dependency getDependencies()

Return Value

Dependency

int getCreationDate()

Return Value

int

int getId()

Return Value

int $id

string getFilename()

Return Value

string

string getKey()

Alias for getFilename()

Return Value

string

int getModificationDate()

Return Value

int

int getParentId()

Return Value

int

string getPath()

Return Value

string

string getType()

Return Value

string

$this setCreationDate(int $creationDate)

Parameters

int $creationDate

Return Value

$this

$this setId(int $id)

Parameters

int $id

Return Value

$this

$this setFilename(string $filename)

Parameters

string $filename

Return Value

$this

$this setModificationDate(int $modificationDate)

Parameters

int $modificationDate

Return Value

$this

$this setParentId(int $parentId)

Parameters

int $parentId

Return Value

$this

$this setPath(string $path)

Parameters

string $path

Return Value

$this

$this setType(string $type)

Parameters

string $type

Return Value

$this

mixed getData()

Return Value

mixed

$this setData(mixed $data)

Parameters

mixed $data

Return Value

$this

resource getStream()

Return Value

resource

$this setStream($stream)

Parameters

$stream

Return Value

$this

protected closeStream()

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

Parameters

string $type

Return Value

null|string

Exceptions

Exception

bool getDataChanged()

Return Value

bool

$this setDataChanged(bool $changed = true)

Parameters

bool $changed

Return Value

$this

array getProperties()

Return Value

array

$this setProperties(array $properties)

Parameters

array $properties

Return Value

$this

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

Parameters

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

Return Value

$this

int getUserOwner()

Return Value

int

int getUserModification()

Return Value

int

$this setUserOwner(int $userOwner)

Parameters

int $userOwner

Return Value

$this

$this setUserModification(int $userModification)

Parameters

int $userModification

Return Value

$this

array getVersions()

Return Value

array

$this setVersions(array $versions)

Parameters

array $versions

Return Value

$this

string getTemporaryFile()

returns the path to a temp file

Return Value

string

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

Parameters

string $key
mixed $value

Return Value

$this

null getCustomSetting($key)

Parameters

$key

Return Value

null

removeCustomSetting($key)

Parameters

$key

array getCustomSettings()

Return Value

array

$this setCustomSettings(array $customSettings)

Parameters

array $customSettings

Return Value

$this

string getMimetype()

Return Value

string

$this setMimetype(string $mimetype)

Parameters

string $mimetype

Return Value

$this

setMetadata(array $metadata)

Parameters

array $metadata

bool getHasMetaData()

Return Value

bool

setHasMetaData(bool $hasMetaData)

Parameters

bool $hasMetaData

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

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

Parameters

null $name
null $language

Return Value

array

array getScheduledTasks()

Return Value

array

$this setScheduledTasks($scheduledTasks)

Parameters

$scheduledTasks

Return Value

$this

saveScheduledTasks()

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

Get filesize

Parameters

string $format ('GB','MB','KB','B')
int $precision

Return Value

string

Asset getParent()

Return Value

Asset

$this setParent(Asset $parent)

Parameters

Asset $parent

Return Value

$this

string getImageThumbnailSavePath()

Return Value

string

string getVideoThumbnailSavePath()

Return Value

string

__wakeup()

removeInheritedProperties()

renewInheritedProperties()

__destruct()

protected int|null readPageCount(null $path = null)

Parameters

null $path

Return Value

int|null

int|null getPageCount()

Return Value

int|null

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

mixed|null getText(null $page = null)

Parameters

null $page

Return Value

mixed|null

clearThumbnails(bool $force = false)

Parameters

bool $force