MediaElement
extends BaseModel
in package
uses
WithOwnerTrait, WithChildrenTrait
Media Element Model
Attributes
Table of Contents
Constants
- MIMETYPE_APPLICATION_BZIP2 = 'application/x-bzip2'
- MIMETYPE_APPLICATION_FONT_OTF = 'font/otf'
- MIMETYPE_APPLICATION_FONT_TTF = 'font/ttf'
- MIMETYPE_APPLICATION_FONT_WOFF = 'application/font-woff'
- MIMETYPE_APPLICATION_FONT_WOFF2 = 'font/woff2'
- MIMETYPE_APPLICATION_GZIP = 'application/gzip'
- MIMETYPE_APPLICATION_JAVA_ARCHIVE = 'application/java-archive'
- MIMETYPE_APPLICATION_JAVASCRIPT = 'application/javascript'
- MIMETYPE_APPLICATION_JSON = 'application/json'
- MIMETYPE_APPLICATION_MP4 = 'application/mp4'
- MIMETYPE_APPLICATION_MSWORD = 'application/msword'
- MIMETYPE_APPLICATION_OCTET_STREAM = 'application/octet-stream'
- MIMETYPE_APPLICATION_OGG = 'application/ogg'
- MIMETYPE_APPLICATION_PDF = 'application/pdf'
- MIMETYPE_APPLICATION_PHP = 'application/x-httpd-php'
- MIMETYPE_APPLICATION_RTF = 'application/rtf'
- MIMETYPE_APPLICATION_SQL = 'application/sql'
- MIMETYPE_APPLICATION_TAR = 'application/x-tar'
- MIMETYPE_APPLICATION_VND_MS_EXCEL = 'application/vnd.ms-excel'
- MIMETYPE_APPLICATION_VND_MS_POWERPOINT = 'application/vnd.ms-powerpoint'
- MIMETYPE_APPLICATION_VND_OPENXML_EXCEL = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
- MIMETYPE_APPLICATION_VND_OPENXML_POWERPOINT = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
- MIMETYPE_APPLICATION_VND_OPENXML_WORD = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
- MIMETYPE_APPLICATION_X_7Z = 'application/x-7z-compressed'
- MIMETYPE_APPLICATION_X_APPIMAGE = 'application/x-appimage'
- MIMETYPE_APPLICATION_X_DEB = 'application/vnd.debian.binary-package'
- MIMETYPE_APPLICATION_X_MS_DOWNLOAD = 'application/x-msdownload'
- MIMETYPE_APPLICATION_X_RAR = 'application/vnd.rar'
- MIMETYPE_APPLICATION_X_SHOCKWAVE_FLASH = 'application/x-shockwave-flash'
- MIMETYPE_APPLICATION_XHTML = 'application/xhtml+xml'
- MIMETYPE_APPLICATION_XML = 'application/xml'
- MIMETYPE_APPLICATION_YAML = 'application/x-yaml'
- MIMETYPE_APPLICATION_ZIP = 'application/zip'
- MIMETYPE_AUDIO_AAC = 'audio/aac'
- MIMETYPE_AUDIO_FLAC = 'audio/flac'
- MIMETYPE_AUDIO_MID = 'audio/midi'
- MIMETYPE_AUDIO_MP4 = 'audio/mp4'
- MIMETYPE_AUDIO_MPEG = 'audio/mpeg'
- MIMETYPE_AUDIO_OGG = 'audio/ogg'
- MIMETYPE_AUDIO_WAV = 'audio/wav'
- MIMETYPE_AUDIO_WEBM = 'audio/webm'
- MIMETYPE_AUDIO_X_MATROSKA = 'audio/x-matroska'
- MIMETYPE_CHEMICAL_X_CIF = 'chemical/x-cif'
- MIMETYPE_CHEMICAL_X_PDB = 'chemical/x-pdb'
- MIMETYPE_IMAGE_AVIF = 'image/avif'
- MIMETYPE_IMAGE_BMP = 'image/bmp'
- MIMETYPE_IMAGE_GIF = 'image/gif'
- MIMETYPE_IMAGE_HEIC = 'image/heic'
- MIMETYPE_IMAGE_JPEG = 'image/jpeg'
- MIMETYPE_IMAGE_PNG = 'image/png'
- MIMETYPE_IMAGE_SVG = 'image/svg+xml'
- MIMETYPE_IMAGE_TIFF = 'image/tiff'
- MIMETYPE_IMAGE_WEBP = 'image/webp'
- MIMETYPE_IMAGE_X_ICON = 'image/x-icon'
- MIMETYPE_INODE_DIRECTORY = 'inode/directory'
- MIMETYPE_MESSAGE_RFC822 = 'message/rfc822'
- MIMETYPE_MODEL_GLB = 'model/gltf-binary'
- MIMETYPE_MODEL_GLTF = 'model/gltf+json'
- MIMETYPE_MODEL_OBJ = 'model/obj'
- MIMETYPE_MODEL_STL = 'model/stl'
- MIMETYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative'
- MIMETYPE_MULTIPART_FORMDATA = 'multipart/form-data'
- MIMETYPE_MULTIPART_MIXED = 'multipart/mixed'
- MIMETYPE_MULTIPART_RELATED = 'multipart/related'
- MIMETYPE_TEXT_CSS = 'text/css'
- MIMETYPE_TEXT_CSV = 'text/csv'
- MIMETYPE_TEXT_HTML = 'text/html'
- MIMETYPE_TEXT_MARKDOWN = 'text/markdown'
- MIMETYPE_TEXT_PLAIN = 'text/plain'
- MIMETYPE_TEXT_RICHTEXT = 'text/richtext'
- MIMETYPE_TEXT_VCARD = 'text/vcard'
- MIMETYPE_TEXT_VTT = 'text/vtt'
- MIMETYPE_TEXT_XML = 'text/xml'
- MIMETYPE_VIDEO_MP4 = 'video/mp4'
- MIMETYPE_VIDEO_OGG = 'video/ogg'
- MIMETYPE_VIDEO_QUICKTIME = 'video/quicktime'
- MIMETYPE_VIDEO_WEBM = 'video/webm'
- MIMETYPE_VIDEO_X_FLV = 'video/x-flv'
- MIMETYPE_VIDEO_X_MATROSKA = 'video/x-matroska'
- MIMETYPE_VIDEO_X_MSVIDEO = 'video/x-msvideo'
- ORIGINAL_SIZE = 'originals'
- TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
Properties
- $table_name : string|null
- $children : array<string|int, mixed>
- $db_row : Row
- $is_first_save : bool
- $keyField : string|array<string|int, mixed>
- $loadedObjects : array<string|int, mixed>
- $original_data : array<string|int, mixed>|null
Methods
- __call() : mixed
- {@inheritdoc}
- __callStatic() : mixed
- {@inheritdoc}
- __construct() : mixed
- {@inheritdoc}
- __get() : mixed
- {@inheritdoc}
- __isset() : bool
- {@inheritdoc}
- __set() : void
- {@inheritdoc}
- __unset() : void
- {@inheritdoc}
- canBeDuplicated() : bool
- Determines if model can be duplicated
- canSaveVersions() : bool
- determines if varsion data should be saved on postPersist hook
- checkLoaded() : self
- ensures model is loaded
- clearThumbs() : void
- deletes mediaElement thumbnails
- copy() : MediaElement
- current() : mixed
- {@inheritdoc}
- defaultTableName() : string
- gets model table name
- delete() : self
- removes model from db
- duplicate() : BaseModel
- Duplicate Model
- ensureConsistency() : self
- ensure directory / file is existing
- fill() : self
- fills empty model with data
- getChangedData() : array<string|int, mixed>|null
- gets model's changed data
- getChildren() : array<string|int, mixed>
- gets children
- getChildrenClass() : string
- getChildrenTableName() : string
- getCollection() : BaseCollection
- returns a Model collection
- getCreatedAt() : DateTime
- getData() : mixed
- gets model's data
- getDescendants() : array<string|int, static>
- Gets all descendant objects recursively
- getFilename() : string
- getFilesize() : int
- getId() : int
- getImage() : string
- gets original image img tag
- getImageBox() : Box|null
- gets Image Box
- getImageUrl() : string
- gets original image url
- getIterator() : Traversable|ArrayIterator
- {@inheritdoc}
- getKeyField() : string|array<string|int, mixed>
- getKeyFieldValue() : mixed
- getLazyload() : bool
- getMimeIcon() : string
- gets the icon for the media element
- getMimetype() : string
- getOwner() : User
- gets owner
- getParentId() : int
- getPath() : string
- getRelativePath() : string
- gets relative path
- getSearchCollection() : BaseCollection
- returns a Model collection using SearchManager for finding elements
- getStream() : resource|false
- return file / directory stream
- getSubTree() : BaseCollection|null
- returns a collection of MEdiaElements contained into the current subtree
- getTableColumns() : array<string|int, mixed>
- returns table columns
- getThumb() : string
- gets thumbnail img html tag
- getThumbUrl() : string
- gets thumbnail url
- getThumbUrl__200x200() : string
- getThumbUrl__300x200() : string
- getThumbUrl__640x480() : string
- getThumbUrl__800x600() : string
- getUpdatedAt() : DateTime
- getUserId() : int
- getVersions() : BaseCollection
- get the collection of version available for current model
- hasChanged() : bool
- hydrateStatementResult() : array<string|int, mixed>
- returns an array of models, starting from a statement Result
- isArchive() : bool
- checks if element is and archive file
- isAudio() : bool
- check if media is an audio
- isCsv() : bool
- checks if element is csv file
- isDirectory() : bool
- check if media is a directory
- isExportable() : bool
- {@inheritdoc}
- isFirstSave() : bool
- is first save flag
- isImage() : bool
- check if media is an image
- isLoaded() : bool
- checks if model is loaded
- isMimetype() : bool
- Checks if the current mimetype matches the given pattern.
- isNew() : bool
- checks if model is new
- isPlainText() : bool
- checks if element is plain text file
- isVideo() : bool
- check if media is a video
- key() : mixed
- {@inheritdoc}
- load() : self
- loads model by id
- loadBy() : self
- loads model by field - value pair
- move() : self
- new() : static
- gets new empty model
- next() : mixed
- {@inheritdoc}
- offsetExists() : bool
- {@inheritdoc}
- offsetGet() : mixed
- {@inheritdoc}
- offsetSet() : void
- {@inheritdoc}
- offsetUnset() : void
- {@inheritdoc}
- persist() : self
- saves model on db
- postLoad() : self
- post load hook
- postPersist() : self
- post persist hook
- postRemove() : self
- post remove hook
- prePersist() : self
- pre persist hook
- preRemove() : self
- pre remove hook
- remove() : self
- removes model from db
- reset() : self
- resets model
- restoreVersion() : static
- Restore a previous version of the model
- rewind() : mixed
- {@inheritdoc}
- save() : self
- saves model on db
- saveVersion() : ModelVersion
- creates a version of current model
- select() : PDOStatement
- basic select statement
- serializeForVersioning() : array<string|int, mixed>
- setCreatedAt() : self
- setData() : self
- sets model's data
- setFilename() : self
- setFilesize() : self
- setId() : self
- setIsFirstSave() : $this
- sets is first save flag
- setLazyload() : self
- setMimetype() : self
- setParentId() : self
- setPath() : self
- setTableName() : self
- setUpdatedAt() : self
- setUserId() : self
- toJson() : string
- gets Model json rapresentation
- valid() : mixed
- {@inheritdoc}
- applyRestoredField() : void
- Apply a restored field to the current model
- cmpPosition() : int
- emitEvent() : void
- Emits event to event manager
- getDbRow() : Row
- getModelBasicWhere() : Result
- gets basic where statement for model
- getModelName() : string
- gets object model name
- getOriginalData() : mixed
- gets model's original data
- getTableName() : string
- gets table name
- loadedObjectsIdentifier() : string
- setDbRow() : self
- setOriginalData() : $this
- sets model's original data
- sortChildren() : void
- sort children by position
- checkDbName() : self
- checks if Row object is from correct table
Constants
MIMETYPE_APPLICATION_BZIP2
public
mixed
MIMETYPE_APPLICATION_BZIP2
= 'application/x-bzip2'
MIMETYPE_APPLICATION_FONT_OTF
public
mixed
MIMETYPE_APPLICATION_FONT_OTF
= 'font/otf'
MIMETYPE_APPLICATION_FONT_TTF
public
mixed
MIMETYPE_APPLICATION_FONT_TTF
= 'font/ttf'
MIMETYPE_APPLICATION_FONT_WOFF
public
mixed
MIMETYPE_APPLICATION_FONT_WOFF
= 'application/font-woff'
MIMETYPE_APPLICATION_FONT_WOFF2
public
mixed
MIMETYPE_APPLICATION_FONT_WOFF2
= 'font/woff2'
MIMETYPE_APPLICATION_GZIP
public
mixed
MIMETYPE_APPLICATION_GZIP
= 'application/gzip'
MIMETYPE_APPLICATION_JAVA_ARCHIVE
public
mixed
MIMETYPE_APPLICATION_JAVA_ARCHIVE
= 'application/java-archive'
MIMETYPE_APPLICATION_JAVASCRIPT
public
mixed
MIMETYPE_APPLICATION_JAVASCRIPT
= 'application/javascript'
MIMETYPE_APPLICATION_JSON
public
mixed
MIMETYPE_APPLICATION_JSON
= 'application/json'
MIMETYPE_APPLICATION_MP4
public
mixed
MIMETYPE_APPLICATION_MP4
= 'application/mp4'
MIMETYPE_APPLICATION_MSWORD
public
mixed
MIMETYPE_APPLICATION_MSWORD
= 'application/msword'
MIMETYPE_APPLICATION_OCTET_STREAM
public
mixed
MIMETYPE_APPLICATION_OCTET_STREAM
= 'application/octet-stream'
MIMETYPE_APPLICATION_OGG
public
mixed
MIMETYPE_APPLICATION_OGG
= 'application/ogg'
MIMETYPE_APPLICATION_PDF
public
mixed
MIMETYPE_APPLICATION_PDF
= 'application/pdf'
MIMETYPE_APPLICATION_PHP
public
mixed
MIMETYPE_APPLICATION_PHP
= 'application/x-httpd-php'
MIMETYPE_APPLICATION_RTF
public
mixed
MIMETYPE_APPLICATION_RTF
= 'application/rtf'
MIMETYPE_APPLICATION_SQL
public
mixed
MIMETYPE_APPLICATION_SQL
= 'application/sql'
MIMETYPE_APPLICATION_TAR
public
mixed
MIMETYPE_APPLICATION_TAR
= 'application/x-tar'
MIMETYPE_APPLICATION_VND_MS_EXCEL
public
mixed
MIMETYPE_APPLICATION_VND_MS_EXCEL
= 'application/vnd.ms-excel'
MIMETYPE_APPLICATION_VND_MS_POWERPOINT
public
mixed
MIMETYPE_APPLICATION_VND_MS_POWERPOINT
= 'application/vnd.ms-powerpoint'
MIMETYPE_APPLICATION_VND_OPENXML_EXCEL
public
mixed
MIMETYPE_APPLICATION_VND_OPENXML_EXCEL
= 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
MIMETYPE_APPLICATION_VND_OPENXML_POWERPOINT
public
mixed
MIMETYPE_APPLICATION_VND_OPENXML_POWERPOINT
= 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
MIMETYPE_APPLICATION_VND_OPENXML_WORD
public
mixed
MIMETYPE_APPLICATION_VND_OPENXML_WORD
= 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
MIMETYPE_APPLICATION_X_7Z
public
mixed
MIMETYPE_APPLICATION_X_7Z
= 'application/x-7z-compressed'
MIMETYPE_APPLICATION_X_APPIMAGE
public
mixed
MIMETYPE_APPLICATION_X_APPIMAGE
= 'application/x-appimage'
MIMETYPE_APPLICATION_X_DEB
public
mixed
MIMETYPE_APPLICATION_X_DEB
= 'application/vnd.debian.binary-package'
MIMETYPE_APPLICATION_X_MS_DOWNLOAD
public
mixed
MIMETYPE_APPLICATION_X_MS_DOWNLOAD
= 'application/x-msdownload'
MIMETYPE_APPLICATION_X_RAR
public
mixed
MIMETYPE_APPLICATION_X_RAR
= 'application/vnd.rar'
MIMETYPE_APPLICATION_X_SHOCKWAVE_FLASH
public
mixed
MIMETYPE_APPLICATION_X_SHOCKWAVE_FLASH
= 'application/x-shockwave-flash'
MIMETYPE_APPLICATION_XHTML
public
mixed
MIMETYPE_APPLICATION_XHTML
= 'application/xhtml+xml'
MIMETYPE_APPLICATION_XML
public
mixed
MIMETYPE_APPLICATION_XML
= 'application/xml'
MIMETYPE_APPLICATION_YAML
public
mixed
MIMETYPE_APPLICATION_YAML
= 'application/x-yaml'
MIMETYPE_APPLICATION_ZIP
public
mixed
MIMETYPE_APPLICATION_ZIP
= 'application/zip'
MIMETYPE_AUDIO_AAC
public
mixed
MIMETYPE_AUDIO_AAC
= 'audio/aac'
MIMETYPE_AUDIO_FLAC
public
mixed
MIMETYPE_AUDIO_FLAC
= 'audio/flac'
MIMETYPE_AUDIO_MID
public
mixed
MIMETYPE_AUDIO_MID
= 'audio/midi'
MIMETYPE_AUDIO_MP4
public
mixed
MIMETYPE_AUDIO_MP4
= 'audio/mp4'
MIMETYPE_AUDIO_MPEG
public
mixed
MIMETYPE_AUDIO_MPEG
= 'audio/mpeg'
MIMETYPE_AUDIO_OGG
public
mixed
MIMETYPE_AUDIO_OGG
= 'audio/ogg'
MIMETYPE_AUDIO_WAV
public
mixed
MIMETYPE_AUDIO_WAV
= 'audio/wav'
MIMETYPE_AUDIO_WEBM
public
mixed
MIMETYPE_AUDIO_WEBM
= 'audio/webm'
MIMETYPE_AUDIO_X_MATROSKA
public
mixed
MIMETYPE_AUDIO_X_MATROSKA
= 'audio/x-matroska'
MIMETYPE_CHEMICAL_X_CIF
public
mixed
MIMETYPE_CHEMICAL_X_CIF
= 'chemical/x-cif'
MIMETYPE_CHEMICAL_X_PDB
public
mixed
MIMETYPE_CHEMICAL_X_PDB
= 'chemical/x-pdb'
MIMETYPE_IMAGE_AVIF
public
mixed
MIMETYPE_IMAGE_AVIF
= 'image/avif'
MIMETYPE_IMAGE_BMP
public
mixed
MIMETYPE_IMAGE_BMP
= 'image/bmp'
MIMETYPE_IMAGE_GIF
public
mixed
MIMETYPE_IMAGE_GIF
= 'image/gif'
MIMETYPE_IMAGE_HEIC
public
mixed
MIMETYPE_IMAGE_HEIC
= 'image/heic'
MIMETYPE_IMAGE_JPEG
public
mixed
MIMETYPE_IMAGE_JPEG
= 'image/jpeg'
MIMETYPE_IMAGE_PNG
public
mixed
MIMETYPE_IMAGE_PNG
= 'image/png'
MIMETYPE_IMAGE_SVG
public
mixed
MIMETYPE_IMAGE_SVG
= 'image/svg+xml'
MIMETYPE_IMAGE_TIFF
public
mixed
MIMETYPE_IMAGE_TIFF
= 'image/tiff'
MIMETYPE_IMAGE_WEBP
public
mixed
MIMETYPE_IMAGE_WEBP
= 'image/webp'
MIMETYPE_IMAGE_X_ICON
public
mixed
MIMETYPE_IMAGE_X_ICON
= 'image/x-icon'
MIMETYPE_INODE_DIRECTORY
public
mixed
MIMETYPE_INODE_DIRECTORY
= 'inode/directory'
MIMETYPE_MESSAGE_RFC822
public
mixed
MIMETYPE_MESSAGE_RFC822
= 'message/rfc822'
MIMETYPE_MODEL_GLB
public
mixed
MIMETYPE_MODEL_GLB
= 'model/gltf-binary'
MIMETYPE_MODEL_GLTF
public
mixed
MIMETYPE_MODEL_GLTF
= 'model/gltf+json'
MIMETYPE_MODEL_OBJ
public
mixed
MIMETYPE_MODEL_OBJ
= 'model/obj'
MIMETYPE_MODEL_STL
public
mixed
MIMETYPE_MODEL_STL
= 'model/stl'
MIMETYPE_MULTIPART_ALTERNATIVE
public
mixed
MIMETYPE_MULTIPART_ALTERNATIVE
= 'multipart/alternative'
MIMETYPE_MULTIPART_FORMDATA
public
mixed
MIMETYPE_MULTIPART_FORMDATA
= 'multipart/form-data'
MIMETYPE_MULTIPART_MIXED
public
mixed
MIMETYPE_MULTIPART_MIXED
= 'multipart/mixed'
MIMETYPE_MULTIPART_RELATED
public
mixed
MIMETYPE_MULTIPART_RELATED
= 'multipart/related'
MIMETYPE_TEXT_CSS
public
mixed
MIMETYPE_TEXT_CSS
= 'text/css'
MIMETYPE_TEXT_CSV
public
mixed
MIMETYPE_TEXT_CSV
= 'text/csv'
MIMETYPE_TEXT_HTML
public
mixed
MIMETYPE_TEXT_HTML
= 'text/html'
MIMETYPE_TEXT_MARKDOWN
public
mixed
MIMETYPE_TEXT_MARKDOWN
= 'text/markdown'
MIMETYPE_TEXT_PLAIN
public
mixed
MIMETYPE_TEXT_PLAIN
= 'text/plain'
MIMETYPE_TEXT_RICHTEXT
public
mixed
MIMETYPE_TEXT_RICHTEXT
= 'text/richtext'
MIMETYPE_TEXT_VCARD
public
mixed
MIMETYPE_TEXT_VCARD
= 'text/vcard'
MIMETYPE_TEXT_VTT
public
mixed
MIMETYPE_TEXT_VTT
= 'text/vtt'
MIMETYPE_TEXT_XML
public
mixed
MIMETYPE_TEXT_XML
= 'text/xml'
MIMETYPE_VIDEO_MP4
public
mixed
MIMETYPE_VIDEO_MP4
= 'video/mp4'
MIMETYPE_VIDEO_OGG
public
mixed
MIMETYPE_VIDEO_OGG
= 'video/ogg'
MIMETYPE_VIDEO_QUICKTIME
public
mixed
MIMETYPE_VIDEO_QUICKTIME
= 'video/quicktime'
MIMETYPE_VIDEO_WEBM
public
mixed
MIMETYPE_VIDEO_WEBM
= 'video/webm'
MIMETYPE_VIDEO_X_FLV
public
mixed
MIMETYPE_VIDEO_X_FLV
= 'video/x-flv'
MIMETYPE_VIDEO_X_MATROSKA
public
mixed
MIMETYPE_VIDEO_X_MATROSKA
= 'video/x-matroska'
MIMETYPE_VIDEO_X_MSVIDEO
public
mixed
MIMETYPE_VIDEO_X_MSVIDEO
= 'video/x-msvideo'
ORIGINAL_SIZE
public
mixed
ORIGINAL_SIZE
= 'originals'
TRANSPARENT_PIXEL
public
mixed
TRANSPARENT_PIXEL
= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='
Properties
$table_name
public
string|null
$table_name
= null
table name
$children
protected
array<string|int, mixed>
$children
= []
children
$db_row
protected
Row
$db_row
= null
database row
$is_first_save
protected
bool
$is_first_save
first save flag
$keyField
protected
static string|array<string|int, mixed>
$keyField
= 'id'
$loadedObjects
protected
static array<string|int, mixed>
$loadedObjects
= []
objects cache
$original_data
private
array<string|int, mixed>|null
$original_data
= null
original model data
Methods
__call()
{@inheritdoc}
public
__call(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__callStatic()
{@inheritdoc}
public
static __callStatic(string $name, mixed $arguments) : mixed
Parameters
- $name : string
- $arguments : mixed
Tags
__construct()
{@inheritdoc}
public
__construct([Row|null $db_row = null ]) : mixed
Parameters
- $db_row : Row|null = null
Tags
__get()
{@inheritdoc}
public
__get(mixed $key) : mixed
Parameters
- $key : mixed
__isset()
{@inheritdoc}
public
__isset(mixed $name) : bool
Parameters
- $name : mixed
Return values
bool__set()
{@inheritdoc}
public
__set(mixed $key, mixed $value) : void
Parameters
- $key : mixed
- $value : mixed
__unset()
{@inheritdoc}
public
__unset(mixed $name) : void
Parameters
- $name : mixed
canBeDuplicated()
Determines if model can be duplicated
public
static canBeDuplicated() : bool
Return values
boolcanSaveVersions()
determines if varsion data should be saved on postPersist hook
public
canSaveVersions() : bool
Return values
boolcheckLoaded()
ensures model is loaded
public
checkLoaded() : self
Tags
Return values
selfclearThumbs()
deletes mediaElement thumbnails
public
clearThumbs() : void
copy()
public
copy(string $destination) : MediaElement
Parameters
- $destination : string
Return values
MediaElementcurrent()
{@inheritdoc}
public
current() : mixed
defaultTableName()
gets model table name
public
static defaultTableName() : string
Return values
stringdelete()
removes model from db
public
delete() : self
Tags
Return values
selfduplicate()
Duplicate Model
public
duplicate() : BaseModel
Return values
BaseModelensureConsistency()
ensure directory / file is existing
public
ensureConsistency() : self
Return values
selffill()
fills empty model with data
public
fill(int|Row $id) : self
Parameters
- $id : int|Row
Tags
Return values
selfgetChangedData()
gets model's changed data
public
getChangedData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetChildren()
gets children
public
getChildren([string|null $locale = null ][, bool $reset = false ]) : array<string|int, mixed>
Parameters
- $locale : string|null = null
- $reset : bool = false
Return values
array<string|int, mixed>getChildrenClass()
public
getChildrenClass() : string
Return values
stringgetChildrenTableName()
public
getChildrenTableName() : string
Return values
stringgetCollection()
returns a Model collection
public
static getCollection() : BaseCollection
Return values
BaseCollectiongetCreatedAt()
public
getCreatedAt() : DateTime
Return values
DateTimegetData()
gets model's data
public
getData([mixed|null $column = null ]) : mixed
Parameters
- $column : mixed|null = null
getDescendants()
Gets all descendant objects recursively
public
getDescendants() : array<string|int, static>
Return values
array<string|int, static>getFilename()
public
getFilename() : string
Return values
stringgetFilesize()
public
getFilesize() : int
Return values
intgetId()
public
getId() : int
Return values
intgetImage()
gets original image img tag
public
getImage([string $class = 'img-fluid' ]) : string
Parameters
- $class : string = 'img-fluid'
Tags
Attributes
Return values
stringgetImageBox()
gets Image Box
public
getImageBox() : Box|null
Return values
Box|nullgetImageUrl()
gets original image url
public
getImageUrl() : string
Tags
Attributes
Return values
stringgetIterator()
{@inheritdoc}
public
getIterator() : Traversable|ArrayIterator
Return values
Traversable|ArrayIteratorgetKeyField()
public
static getKeyField() : string|array<string|int, mixed>
Return values
string|array<string|int, mixed>getKeyFieldValue()
public
getKeyFieldValue([bool $forceAsArray = false ]) : mixed
Parameters
- $forceAsArray : bool = false
getLazyload()
public
getLazyload() : bool
Return values
boolgetMimeIcon()
gets the icon for the media element
public
getMimeIcon([string $theme = 'regular' ]) : string
Parameters
- $theme : string = 'regular'
Attributes
Return values
stringgetMimetype()
public
getMimetype() : string
Return values
stringgetOwner()
gets owner
public
getOwner() : User
Tags
Attributes
Return values
UsergetParentId()
public
getParentId() : int
Return values
intgetPath()
public
getPath() : string
Return values
stringgetRelativePath()
gets relative path
public
getRelativePath() : string
Tags
Return values
stringgetSearchCollection()
returns a Model collection using SearchManager for finding elements
public
static getSearchCollection([array<string|int, mixed> $conditions = [] ]) : BaseCollection
Parameters
- $conditions : array<string|int, mixed> = []
Return values
BaseCollectiongetStream()
return file / directory stream
public
getStream() : resource|false
Return values
resource|falsegetSubTree()
returns a collection of MEdiaElements contained into the current subtree
public
getSubTree() : BaseCollection|null
Return values
BaseCollection|nullgetTableColumns()
returns table columns
public
static getTableColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>getThumb()
gets thumbnail img html tag
public
getThumb(string $size[, string|null $mode = null ][, string|null $class = null ][, array<string|int, mixed> $img_attributes = [] ]) : string
Parameters
- $size : string
- $mode : string|null = null
- $class : string|null = null
- $img_attributes : array<string|int, mixed> = []
Tags
Return values
stringgetThumbUrl()
gets thumbnail url
public
getThumbUrl(string $size[, string|null $mode = null ]) : string
Parameters
- $size : string
- $mode : string|null = null
Tags
Return values
stringgetThumbUrl__200x200()
public
getThumbUrl__200x200() : string
Return values
stringgetThumbUrl__300x200()
public
getThumbUrl__300x200() : string
Return values
stringgetThumbUrl__640x480()
public
getThumbUrl__640x480() : string
Return values
stringgetThumbUrl__800x600()
public
getThumbUrl__800x600() : string
Return values
stringgetUpdatedAt()
public
getUpdatedAt() : DateTime
Return values
DateTimegetUserId()
public
getUserId() : int
Return values
intgetVersions()
get the collection of version available for current model
public
getVersions() : BaseCollection
Return values
BaseCollectionhasChanged()
public
hasChanged() : bool
Return values
boolhydrateStatementResult()
returns an array of models, starting from a statement Result
public
static hydrateStatementResult(Result $stmt) : array<string|int, mixed>
Parameters
- $stmt : Result
Tags
Return values
array<string|int, mixed>isArchive()
checks if element is and archive file
public
isArchive() : bool
Return values
boolisAudio()
check if media is an audio
public
isAudio() : bool
Return values
boolisCsv()
checks if element is csv file
public
isCsv() : bool
Return values
boolisDirectory()
check if media is a directory
public
isDirectory() : bool
Return values
boolisExportable()
{@inheritdoc}
public
static isExportable() : bool
Return values
boolisFirstSave()
is first save flag
public
isFirstSave() : bool
Return values
boolisImage()
check if media is an image
public
isImage() : bool
Return values
boolisLoaded()
checks if model is loaded
public
isLoaded() : bool
Return values
boolisMimetype()
Checks if the current mimetype matches the given pattern.
public
isMimetype(string $regexp) : bool
Accepts either a full mimetype string (e.g. "image/png") or a partial regex (e.g. "^image/").
Parameters
- $regexp : string
Return values
boolisNew()
checks if model is new
public
isNew() : bool
Return values
boolisPlainText()
checks if element is plain text file
public
isPlainText() : bool
Return values
boolisVideo()
check if media is a video
public
isVideo() : bool
Return values
boolkey()
{@inheritdoc}
public
key() : mixed
load()
loads model by id
public
static load(mixed $id[, bool $reset = false ]) : self
Parameters
- $id : mixed
- $reset : bool = false
Return values
selfloadBy()
loads model by field - value pair
public
static loadBy(string $field, mixed $value) : self
Parameters
- $field : string
- $value : mixed
Tags
Return values
selfmove()
public
move(string $destination) : self
Parameters
- $destination : string
Return values
selfnew()
gets new empty model
public
static new([array<string|int, mixed> $initial_data = [] ]) : static
Parameters
- $initial_data : array<string|int, mixed> = []
Tags
Return values
staticnext()
{@inheritdoc}
public
next() : mixed
offsetExists()
{@inheritdoc}
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
{@inheritdoc}
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
{@inheritdoc}
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
{@inheritdoc}
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
persist()
saves model on db
public
persist([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
- $persistOptions : array<string|int, mixed> = []
Tags
Return values
selfpostLoad()
post load hook
public
postLoad() : self
Return values
selfpostPersist()
post persist hook
public
postPersist([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
- $persistOptions : array<string|int, mixed> = []
Return values
selfpostRemove()
post remove hook
public
postRemove() : self
Return values
selfprePersist()
pre persist hook
public
prePersist([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
- $persistOptions : array<string|int, mixed> = []
Return values
selfpreRemove()
pre remove hook
public
preRemove() : self
Return values
selfremove()
removes model from db
public
remove() : self
Tags
Return values
selfreset()
resets model
public
reset() : self
Tags
Return values
selfrestoreVersion()
Restore a previous version of the model
public
restoreVersion(ModelVersion $version[, bool $deep = true ]) : static
Parameters
- $version : ModelVersion
- $deep : bool = true
Tags
Return values
staticrewind()
{@inheritdoc}
public
rewind() : mixed
save()
saves model on db
public
save([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
- $persistOptions : array<string|int, mixed> = []
Tags
Return values
selfsaveVersion()
creates a version of current model
public
saveVersion() : ModelVersion
Return values
ModelVersionselect()
basic select statement
public
static select([array<string|int, mixed> $options = [] ]) : PDOStatement
Parameters
- $options : array<string|int, mixed> = []
Return values
PDOStatementserializeForVersioning()
public
static serializeForVersioning(BaseModel $model[, array<string|int, mixed> &$visited = [] ][, int $depth = 0 ][, int $maxDepth = 1 ]) : array<string|int, mixed>
Parameters
- $model : BaseModel
- $visited : array<string|int, mixed> = []
- $depth : int = 0
- $maxDepth : int = 1
Return values
array<string|int, mixed>setCreatedAt()
public
setCreatedAt(DateTime $created_at) : self
Parameters
- $created_at : DateTime
Return values
selfsetData()
sets model's data
public
setData(array<string|int, mixed> $data) : self
Parameters
- $data : array<string|int, mixed>
Return values
selfsetFilename()
public
setFilename(string $filename) : self
Parameters
- $filename : string
Return values
selfsetFilesize()
public
setFilesize(int $filesize) : self
Parameters
- $filesize : int
Return values
selfsetId()
public
setId(int $id) : self
Parameters
- $id : int
Return values
selfsetIsFirstSave()
sets is first save flag
public
setIsFirstSave(bool $is_first_save) : $this
Parameters
- $is_first_save : bool
Return values
$thissetLazyload()
public
setLazyload(bool $lazyload) : self
Parameters
- $lazyload : bool
Return values
selfsetMimetype()
public
setMimetype(string $mimetype) : self
Parameters
- $mimetype : string
Return values
selfsetParentId()
public
setParentId(int $parent_id) : self
Parameters
- $parent_id : int
Return values
selfsetPath()
public
setPath(string $path) : self
Parameters
- $path : string
Return values
selfsetTableName()
public
setTableName(string $table_name) : self
Parameters
- $table_name : string
Return values
selfsetUpdatedAt()
public
setUpdatedAt(DateTime $updated_at) : self
Parameters
- $updated_at : DateTime
Return values
selfsetUserId()
public
setUserId(int $user_id) : self
Parameters
- $user_id : int
Return values
selftoJson()
gets Model json rapresentation
public
toJson([int $level = 0 ]) : string
Parameters
- $level : int = 0
-
internally used
Return values
stringvalid()
{@inheritdoc}
public
valid() : mixed
applyRestoredField()
Apply a restored field to the current model
protected
applyRestoredField(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
cmpPosition()
protected
cmpPosition(ModelWithChildren $a, ModelWithChildren $b) : int
Parameters
- $a : ModelWithChildren
- $b : ModelWithChildren
Return values
intemitEvent()
Emits event to event manager
protected
emitEvent(mixed $eventName[, array<string|int, mixed> $additionalData = [] ]) : void
Parameters
- $eventName : mixed
- $additionalData : array<string|int, mixed> = []
getDbRow()
protected
getDbRow() : Row
Return values
Row —database row
getModelBasicWhere()
gets basic where statement for model
protected
static getModelBasicWhere([array<string|int, mixed>|null $condition = [] ][, array<string|int, mixed> $order = [] ]) : Result
Parameters
- $condition : array<string|int, mixed>|null = []
- $order : array<string|int, mixed> = []
Return values
ResultgetModelName()
gets object model name
protected
getModelName() : string
Return values
stringgetOriginalData()
gets model's original data
protected
getOriginalData([mixed|null $key = null ]) : mixed
Parameters
- $key : mixed|null = null
getTableName()
gets table name
protected
getTableName() : string
Return values
stringloadedObjectsIdentifier()
protected
static loadedObjectsIdentifier(mixed $id) : string
Parameters
- $id : mixed
Return values
stringsetDbRow()
protected
setDbRow(Row $db_row) : self
Parameters
- $db_row : Row
Return values
selfsetOriginalData()
sets model's original data
protected
setOriginalData(array<string|int, mixed>|null $original_data) : $this
Parameters
- $original_data : array<string|int, mixed>|null
Return values
$thissortChildren()
sort children by position
protected
sortChildren() : void
checkDbName()
checks if Row object is from correct table
private
checkDbName(Row $db_row) : self
Parameters
- $db_row : Row