QubitDigitalObject
in package
uses
QubitModelTrait
Table of Contents
Constants
- BYTE_SIZE = 'digital_object.byte_size'
- CHECKSUM = 'digital_object.checksum'
- CHECKSUM_TYPE = 'digital_object.checksum_type'
- GENERIC_ICON_DIR = 'generic-icons'
- ID = 'digital_object.id'
- MEDIA_TYPE_ID = 'digital_object.media_type_id'
- MIME_TYPE = 'digital_object.mime_type'
- NAME = 'digital_object.name'
- OBJECT_ID = 'digital_object.object_id'
- PARENT_ID = 'digital_object.parent_id'
- PATH = 'digital_object.path'
- SEQUENCE = 'digital_object.sequence'
- THUMB_EXTENSION = 'jpg'
- THUMB_MIME_TYPE = 'image/jpeg'
- USAGE_ID = 'digital_object.usage_id'
Properties
- $qubitMimeTypes : mixed
Methods
- __call() : mixed
- Magic method caller — handles Propel-style getXxx() accessors and i18n field getters with cultureFallback option.
- __get() : mixed
- Magic property access — resolves camelCase to snake_case columns, Propel relationships, and serialized property table values.
- __isset() : bool
- canThumbnail() : bool
- Check if a MIME type can be thumbnailed.
- canThumbnailMimeType() : bool
- Static check if a MIME type supports thumbnail generation.
- deriveMimeType() : string|null
- Derive MIME type from a filename's extension.
- getAbsolutePath() : string
- Get absolute filesystem path.
- getAll() : Collection
- Get all rows matching criteria.
- getAncestors() : object
- Get ancestors using MPTT (nested set) lft/rgt columns.
- getById() : static|null
- Load an entity by primary key.
- getBySlug() : object|null
- Load an entity by slug.
- getChildByUsageId() : static|null
- Get child digital object by usage ID (thumbnail, reference, etc.).
- getChildren() : Collection
- Get children using MPTT parent_id.
- getFullPath() : string
- Get full relative path (path + name).
- getGenericIconPath() : string|null
- Get generic icon path for a MIME type and usage type.
- getGenericRepresentation() : static
- Get a generic representation stub for a MIME type.
- getImageMaxDimensions() : array<string|int, mixed>
- Get maximum image dimensions for a given usage ID.
- getMaxUploadSize() : int
- Get the maximum upload size (bytes) from PHP configuration.
- getOne() : object|null
- Get a single row matching criteria.
- getTaxonomy() : object|null
- Get taxonomy (for terms).
- hydrate() : static
- Hydrate a database row into an instance of the calling class.
- isImage() : bool
- Check if this digital object is an image (by media type).
- isWebCompatibleImageFormat() : bool
- Check if this digital object is a web-compatible image format.
- showAsCompoundDigitalObject() : bool
- Check if digital object should be displayed as a compound object.
Constants
BYTE_SIZE
public
mixed
BYTE_SIZE
= 'digital_object.byte_size'
CHECKSUM
public
mixed
CHECKSUM
= 'digital_object.checksum'
CHECKSUM_TYPE
public
mixed
CHECKSUM_TYPE
= 'digital_object.checksum_type'
GENERIC_ICON_DIR
public
mixed
GENERIC_ICON_DIR
= 'generic-icons'
ID
public
mixed
ID
= 'digital_object.id'
MEDIA_TYPE_ID
public
mixed
MEDIA_TYPE_ID
= 'digital_object.media_type_id'
MIME_TYPE
public
mixed
MIME_TYPE
= 'digital_object.mime_type'
NAME
public
mixed
NAME
= 'digital_object.name'
OBJECT_ID
public
mixed
OBJECT_ID
= 'digital_object.object_id'
PARENT_ID
public
mixed
PARENT_ID
= 'digital_object.parent_id'
PATH
public
mixed
PATH
= 'digital_object.path'
SEQUENCE
public
mixed
SEQUENCE
= 'digital_object.sequence'
THUMB_EXTENSION
public
mixed
THUMB_EXTENSION
= 'jpg'
THUMB_MIME_TYPE
public
mixed
THUMB_MIME_TYPE
= 'image/jpeg'
USAGE_ID
public
mixed
USAGE_ID
= 'digital_object.usage_id'
Properties
$qubitMimeTypes
public
static mixed
$qubitMimeTypes
= []
Methods
__call()
Magic method caller — handles Propel-style getXxx() accessors and i18n field getters with cultureFallback option.
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__get()
Magic property access — resolves camelCase to snake_case columns, Propel relationships, and serialized property table values.
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
boolcanThumbnail()
Check if a MIME type can be thumbnailed.
public
canThumbnail() : bool
Return values
boolcanThumbnailMimeType()
Static check if a MIME type supports thumbnail generation.
public
static canThumbnailMimeType(string $mimeType) : bool
Parameters
- $mimeType : string
-
MIME type
Return values
boolderiveMimeType()
Derive MIME type from a filename's extension.
public
static deriveMimeType(string $filename) : string|null
Parameters
- $filename : string
-
Filename or path
Return values
string|null —MIME type or null if unknown
getAbsolutePath()
Get absolute filesystem path.
public
getAbsolutePath() : string
Return values
stringgetAll()
Get all rows matching criteria.
public
static getAll([array<string|int, mixed> $criteria = [] ]) : Collection
Parameters
- $criteria : array<string|int, mixed> = []
-
Column => value pairs
Return values
CollectiongetAncestors()
Get ancestors using MPTT (nested set) lft/rgt columns.
public
getAncestors() : object
Returns a fluent collection wrapper that supports andSelf() and orderBy().
Return values
object —Collection-like object with andSelf(), orderBy(), get() methods
getById()
Load an entity by primary key.
public
static getById(int $id[, array<string|int, mixed> $options = [] ]) : static|null
Delegates to EntityQueryService when the class is mapped there, otherwise falls back to a direct table query.
Returns an instance of the calling class so that instanceof checks
work correctly (e.g., $obj instanceof QubitTaxonomy).
Parameters
- $id : int
- $options : array<string|int, mixed> = []
-
Optional. Keys: 'culture' => string
Return values
static|null —Instance of calling class or null
getBySlug()
Load an entity by slug.
public
static getBySlug(string $slug[, array<string|int, mixed> $options = [] ]) : object|null
Parameters
- $slug : string
- $options : array<string|int, mixed> = []
-
Optional. Keys: 'culture' => string
Return values
object|nullgetChildByUsageId()
Get child digital object by usage ID (thumbnail, reference, etc.).
public
getChildByUsageId(int $usageId) : static|null
Parameters
- $usageId : int
-
Usage type ID (QubitTerm::THUMBNAIL_ID, etc.)
Return values
static|nullgetChildren()
Get children using MPTT parent_id.
public
getChildren() : Collection
Return values
CollectiongetFullPath()
Get full relative path (path + name).
public
getFullPath() : string
Return values
stringgetGenericIconPath()
Get generic icon path for a MIME type and usage type.
public
static getGenericIconPath(string $mimeType, int $usageType) : string|null
Parameters
- $mimeType : string
-
MIME type
- $usageType : int
-
Usage ID (QubitTerm::THUMBNAIL_ID, REFERENCE_ID, etc.)
Return values
string|null —Relative path to icon
getGenericRepresentation()
Get a generic representation stub for a MIME type.
public
static getGenericRepresentation(string $mimeType, int $usageType) : static
Parameters
- $mimeType : string
-
MIME type
- $usageType : int
-
Usage type ID
Return values
static —Stub instance with path set to icon
getImageMaxDimensions()
Get maximum image dimensions for a given usage ID.
public
static getImageMaxDimensions(int $usageId) : array<string|int, mixed>
Parameters
- $usageId : int
-
Usage type ID
Return values
array<string|int, mixed> —[width, height]
getMaxUploadSize()
Get the maximum upload size (bytes) from PHP configuration.
public
static getMaxUploadSize() : int
Return values
int —Size in bytes
getOne()
Get a single row matching criteria.
public
static getOne([array<string|int, mixed> $criteria = [] ]) : object|null
Parameters
- $criteria : array<string|int, mixed> = []
-
Column => value pairs
Return values
object|nullgetTaxonomy()
Get taxonomy (for terms).
public
getTaxonomy() : object|null
Return values
object|nullhydrate()
Hydrate a database row into an instance of the calling class.
public
static hydrate(object $row) : static
Copies all stdClass properties onto a new instance so that
instanceof checks work correctly (e.g., $obj instanceof QubitTaxonomy).
Also resolves the parent property from the MPTT parent_id column
in the object table (Qubit entities inherit from object).
Parameters
- $row : object
-
stdClass from DB query
Return values
staticisImage()
Check if this digital object is an image (by media type).
public
isImage() : bool
Return values
boolisWebCompatibleImageFormat()
Check if this digital object is a web-compatible image format.
public
isWebCompatibleImageFormat() : bool
Return values
boolshowAsCompoundDigitalObject()
Check if digital object should be displayed as a compound object.
public
showAsCompoundDigitalObject() : bool