ModelFiles module

ImageRevision

A model in the Files module, with 20 members for templates, 16 API properties and 20 members for admin templates.

Files\Models\Frontend\ImageRevision Files\Models\Api\ImageRevision Files\Models\Backend\ImageRevision Also in Files: FavoriteFilename FavoriteFolder File FileRevision Filename FilenameComment Folder FolderComment Image SharedFilename VirtualFile
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 19

Take no arguments.

# getMimeType()
string
Get the mime type of the image revision
# getFormat()
string
Get the format of the image revision
# getAspectRation()
float
Get the aspect ration for the image revision based on the images width and height
# isActiveRevision()
bool
Check if the revision is the active revision
# isBlank()
bool
Return the information that this is not a revision of the blank image
# getId()
?int
# getWidth()
?int
Get the width of the image in pixels
# getHeight()
?int
Get the height of the image in pixels
# getName()
?string
Get the name of the image revision - this is usually used as ALT text
# getText()
?string
Get the description of the image revision - this is usually only used internally, e.g. to explain changes in a new revision
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getCreatedBy()
?User
# getModifiedBy()
?User
# getImage()
?Image
# getVirtualFile()
?VirtualFile
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

Methods 1

Take arguments. The API serialises only getters that need none.

# getResized(?int $width, ?int $height, string $resizeStrategy)
TransformedImage
Get a resized version of the active revision of the image

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 16

Read-only values on the record.

# mimeType
string
Get the mime type of the image revision
# format
string
Get the format of the image revision
# aspectRation
float
Get the aspect ration for the image revision based on the images width and height
# activeRevision
bool
Check if the revision is the active revision
# blank
bool
Return the information that this is not a revision of the blank image
# id
?int
# width
?int
Get the width of the image in pixels
# height
?int
Get the height of the image in pixels
# name
?string
Get the name of the image revision - this is usually used as ALT text
# text
?string
Get the description of the image revision - this is usually only used internally, e.g. to explain changes in a new revision
# created
?DateTime
Get the date the record was created.
# modified
?DateTime
Get the last modification date for the record.
# createdBy
?User
# modifiedBy
?User
# image
?Image
# virtualFile
?VirtualFile

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 19

Take no arguments.

# getMimeType()
string
Get the mime type of the image revision
# getFormat()
string
Get the format of the image revision
# getAspectRation()
float
Get the aspect ration for the image revision based on the images width and height
# isActiveRevision()
bool
Check if the revision is the active revision
# isBlank()
bool
Return the information that this is not a revision of the blank image
# getId()
?int
# getWidth()
?int
Get the width of the image in pixels
# getHeight()
?int
Get the height of the image in pixels
# getName()
?string
Get the name of the image revision - this is usually used as ALT text
# getText()
?string
Get the description of the image revision - this is usually only used internally, e.g. to explain changes in a new revision
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getCreatedBy()
?User
# getModifiedBy()
?User
# getImage()
?Image
# getVirtualFile()
?VirtualFile
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

Methods 1

Take arguments. The API serialises only getters that need none.

# getResized(?int $width, ?int $height, string $resizeStrategy)
TransformedImage
Get a resized version of the active revision of the image