Documentation

MediaElement extends BaseModel
in package
uses WithOwnerTrait, WithChildrenTrait

Media Element Model

Attributes
#[GraphQLExport]

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'
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'

TRANSPARENT_PIXEL

public mixed TRANSPARENT_PIXEL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='

Properties

$table_name

public string|null $table_name = null

table name

$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
throws
Exception

__callStatic()

{@inheritdoc}

public static __callStatic(string $name, mixed $arguments) : mixed
Parameters
$name : string
$arguments : mixed
Tags
throws
RuntimeException

__construct()

{@inheritdoc}

public __construct([Row|null $db_row = null ]) : mixed
Parameters
$db_row : Row|null = null
Tags
throws
InvalidValueException
throws
BasicException

__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
bool

canSaveVersions()

determines if varsion data should be saved on postPersist hook

public canSaveVersions() : bool
Return values
bool

checkLoaded()

ensures model is loaded

public checkLoaded() : self
Tags
throws
Exception
Return values
self

clearThumbs()

deletes mediaElement thumbnails

public clearThumbs() : void

current()

{@inheritdoc}

public current() : mixed

defaultTableName()

gets model table name

public static defaultTableName() : string
Return values
string

delete()

removes model from db

public delete() : self
Tags
throws
BasicException
Return values
self

ensureConsistency()

ensure directory / file is existing

public ensureConsistency() : self
Return values
self

fill()

fills empty model with data

public fill(int|Row $id) : self
Parameters
$id : int|Row
Tags
throws
InvalidValueException
throws
BasicException
Return values
self

getChangedData()

gets model's changed data

public getChangedData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getChildren()

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>

getChildrenTableName()

public getChildrenTableName() : string
Return values
string

getCreatedAt()

public getCreatedAt() : DateTime
Return values
DateTime

getData()

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
string

getFilesize()

public getFilesize() : int
Return values
int

getImage()

gets original image img tag

public getImage([string $class = 'img-fluid' ]) : string
Parameters
$class : string = 'img-fluid'
Tags
throws
PermissionDeniedException
throws
BasicException
Attributes
#[GraphQLExport]
Return values
string

getImageBox()

gets Image Box

public getImageBox() : Box|null
Return values
Box|null

getIterator()

{@inheritdoc}

public getIterator() : Traversable|ArrayIterator
Return values
Traversable|ArrayIterator

getKeyField()

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
bool

getMimeIcon()

gets the icon for the media element

public getMimeIcon([string $theme = 'regular' ]) : string
Parameters
$theme : string = 'regular'
Attributes
#[GraphQLExport]
Return values
string

getMimetype()

public getMimetype() : string
Return values
string

getParentId()

public getParentId() : int
Return values
int

getRelativePath()

gets relative path

public getRelativePath() : string
Tags
throws
Exception
Return values
string

getSearchCollection()

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
BaseCollection

getStream()

return file / directory stream

public getStream() : resource|false
Return values
resource|false

getTableColumns()

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
throws
PermissionDeniedException
throws
BasicException
Return values
string

getThumbUrl()

gets thumbnail url

public getThumbUrl(string $size[, string|null $mode = null ]) : string
Parameters
$size : string
$mode : string|null = null
Tags
throws
BasicException
throws
PermissionDeniedException
throws
Exception
Return values
string

getThumbUrl__200x200()

public getThumbUrl__200x200() : string
Return values
string

getThumbUrl__300x200()

public getThumbUrl__300x200() : string
Return values
string

getThumbUrl__640x480()

public getThumbUrl__640x480() : string
Return values
string

getThumbUrl__800x600()

public getThumbUrl__800x600() : string
Return values
string

getUpdatedAt()

public getUpdatedAt() : DateTime
Return values
DateTime

hasChanged()

public hasChanged() : bool
Return values
bool

hydrateStatementResult()

returns an array of models, starting from a statement Result

public static hydrateStatementResult(Result $stmt) : array<string|int, mixed>
Parameters
$stmt : Result
Tags
throws
DependencyException
throws
NotFoundException
Return values
array<string|int, mixed>

isArchive()

checks if element is and archive file

public isArchive() : bool
Return values
bool

isAudio()

check if media is an audio

public isAudio() : bool
Return values
bool

isCsv()

checks if element is csv file

public isCsv() : bool
Return values
bool

isDirectory()

check if media is a directory

public isDirectory() : bool
Return values
bool

isExportable()

{@inheritdoc}

public static isExportable() : bool
Return values
bool

isFirstSave()

is first save flag

public isFirstSave() : bool
Return values
bool

isImage()

check if media is an image

public isImage() : bool
Return values
bool

isLoaded()

checks if model is loaded

public isLoaded() : bool
Return values
bool

isMimetype()

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
bool

isNew()

checks if model is new

public isNew() : bool
Return values
bool

isPlainText()

checks if element is plain text file

public isPlainText() : bool
Return values
bool

isVideo()

check if media is a video

public isVideo() : bool
Return values
bool

load()

loads model by id

public static load(mixed $id[, bool $reset = false ]) : self
Parameters
$id : mixed
$reset : bool = false
Return values
self

loadBy()

loads model by field - value pair

public static loadBy(string $field, mixed $value) : self
Parameters
$field : string
$value : mixed
Tags
throws
BasicException
throws
DependencyException
throws
NotFoundException
Return values
self

move()

public move(string $destination) : self
Parameters
$destination : string
Return values
self

new()

gets new empty model

public static new([array<string|int, mixed> $initial_data = [] ]) : static
Parameters
$initial_data : array<string|int, mixed> = []
Tags
throws
InvalidValueException
throws
BasicException
Return values
static

offsetExists()

{@inheritdoc}

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

{@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
throws
BasicException
Return values
self

postLoad()

post load hook

public postLoad() : self
Return values
self

postPersist()

post persist hook

public postPersist([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
$persistOptions : array<string|int, mixed> = []
Return values
self

postRemove()

post remove hook

public postRemove() : self
Return values
self

prePersist()

pre persist hook

public prePersist([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
$persistOptions : array<string|int, mixed> = []
Return values
self

preRemove()

pre remove hook

public preRemove() : self
Return values
self

remove()

removes model from db

public remove() : self
Tags
throws
BasicException
Return values
self

reset()

resets model

public reset() : self
Tags
throws
BasicException
Return values
self

restoreVersion()

Restore a previous version of the model

public restoreVersion(ModelVersion $version[, bool $deep = true ]) : static
Parameters
$version : ModelVersion
$deep : bool = true
Tags
throws
Exception
Return values
static

rewind()

{@inheritdoc}

public rewind() : mixed

save()

saves model on db

public save([array<string|int, mixed> $persistOptions = [] ]) : self
Parameters
$persistOptions : array<string|int, mixed> = []
Tags
throws
BasicException
Return values
self

select()

basic select statement

public static select([array<string|int, mixed> $options = [] ]) : PDOStatement
Parameters
$options : array<string|int, mixed> = []
Return values
PDOStatement

serializeForVersioning()

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
self

setData()

sets model's data

public setData(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

setFilename()

public setFilename(string $filename) : self
Parameters
$filename : string
Return values
self

setFilesize()

public setFilesize(int $filesize) : self
Parameters
$filesize : int
Return values
self

setId()

public setId(int $id) : self
Parameters
$id : int
Return values
self

setIsFirstSave()

sets is first save flag

public setIsFirstSave(bool $is_first_save) : $this
Parameters
$is_first_save : bool
Return values
$this

setLazyload()

public setLazyload(bool $lazyload) : self
Parameters
$lazyload : bool
Return values
self

setMimetype()

public setMimetype(string $mimetype) : self
Parameters
$mimetype : string
Return values
self

setParentId()

public setParentId(int $parent_id) : self
Parameters
$parent_id : int
Return values
self

setPath()

public setPath(string $path) : self
Parameters
$path : string
Return values
self

setTableName()

public setTableName(string $table_name) : self
Parameters
$table_name : string
Return values
self

setUpdatedAt()

public setUpdatedAt(DateTime $updated_at) : self
Parameters
$updated_at : DateTime
Return values
self

setUserId()

public setUserId(int $user_id) : self
Parameters
$user_id : int
Return values
self

toJson()

gets Model json rapresentation

public toJson([int $level = 0 ]) : string
Parameters
$level : int = 0

internally used

Return values
string

valid()

{@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

emitEvent()

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
Result

getModelName()

gets object model name

protected getModelName() : string
Return values
string

getOriginalData()

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
string

loadedObjectsIdentifier()

protected static loadedObjectsIdentifier(mixed $id) : string
Parameters
$id : mixed
Return values
string

setDbRow()

protected setDbRow(Row $db_row) : self
Parameters
$db_row : Row
Return values
self

setOriginalData()

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
$this

checkDbName()

checks if Row object is from correct table

private checkDbName(Row $db_row) : self
Parameters
$db_row : Row
Tags
throws
InvalidValueException
Return values
self

        
On this page

Search results