ImageUsage
extends ImageUsage
in package
Image usage (`cms_system_asset_usages`): module + purpose, e.g. `blog-articles`.
usageKey is the "asset type" the manager returns from getAssetVariantType().
Usages are created only by migration (the label is the translation
admin.system.assetUsages.<usageKey>). The admin changes only keepOriginal and the
assigned variants, which are saved atomically by the Api operation
api/system/asset-usage/save-assignments (table cms_system_asset_usage_variants), not
through a collection on the entity.
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_system_asset_usages'
- #[TableAlias]
- 'imageUsage'
Table of Contents
Properties
- $id : int|null
- $insertDatetime : DateTime
- $keepOriginal : bool
- $moduleId : int
- $position : int
- $updateDatetime : DateTime|null
- $usageKey : string
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getId() : int|null
- getInsertDatetime() : DateTime
- getKeepOriginal() : bool
- getModuleId() : int
- getPosition() : int
- getUpdateDatetime() : DateTime|null
- getUsageKey() : string
- isPersisted() : bool
- setId() : $this
- setInsertDatetime() : $this
- setKeepOriginal() : $this
- setModuleId() : $this
- setPosition() : $this
- setUpdateDatetime() : $this
- setUsageKey() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'usage_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$keepOriginal
protected
bool
$keepOriginal
= true
Attributes
- #[Column]
- $name: 'keep_original'
- $type: 'boolean'
- $options: ['default' => true]
$moduleId
protected
int
$moduleId
= 0
Attributes
- #[Column]
- $name: 'module_id'
- $type: 'integer'
- $options: ['unsigned' => true]
$position
protected
int
$position
= 0
Attributes
- #[Column]
- $name: 'position'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$updateDatetime
protected
DateTime|null
$updateDatetime
= null
Attributes
- #[Column]
- $name: 'update_datetime'
- $type: 'datetime'
- $nullable: true
$usageKey
protected
string
$usageKey
= ''
Attributes
- #[Column]
- $name: 'usage_key'
- $type: 'string'
- $length: 64
- $unique: true
Methods
__construct()
public
__construct([int|null $id = null ][, string $usageKey = '' ][, int $moduleId = 0 ][, bool $keepOriginal = true ][, int $position = 0 ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ]) : mixed
Parameters
- $id : int|null = null
- $usageKey : string = ''
- $moduleId : int = 0
- $keepOriginal : bool = true
- $position : int = 0
- $insertDatetime : DateTime = new DateTime()
- $updateDatetime : DateTime|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetKeepOriginal()
public
getKeepOriginal() : bool
Return values
boolgetModuleId()
public
getModuleId() : int
Return values
intgetPosition()
public
getPosition() : int
Return values
intgetUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullgetUsageKey()
public
getUsageKey() : string
Return values
stringisPersisted()
public
isPersisted() : bool
Return values
boolsetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetKeepOriginal()
public
setKeepOriginal(bool $keepOriginal) : $this
Parameters
- $keepOriginal : bool
Return values
$thissetModuleId()
public
setModuleId(int $moduleId) : $this
Parameters
- $moduleId : int
Return values
$thissetPosition()
public
setPosition(int $position) : $this
Parameters
- $position : int
Return values
$thissetUpdateDatetime()
public
setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
- $updateDatetime : DateTime|null
Return values
$thissetUsageKey()
public
setUsageKey(string $usageKey) : $this
Parameters
- $usageKey : string
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>