ModelFiles module

Filename

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

Files\Models\Frontend\Filename Files\Models\Api\Filename Files\Models\Backend\Filename Also in Files: FavoriteFilename FavoriteFolder File FileRevision FilenameComment Folder FolderComment Image ImageRevision 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 21

Take no arguments.

# getPath()
string
Get the path for the filename including the folder. Also makes sure the path does not contain any forbidden characters by escaping them.
# getExtension()
?string
Get the extension for this filename
# getContent()
File
Get the content available at the filename
# getId()
?int
# getName()
?string
# getType()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getHidden()
?DateTime
# isHidden()
bool
# getExpires()
?DateTime
# isExpiring()
bool
Returns if expire date is set for a filename
# isExpired()
bool
Returns if expire date (if it is set) has come
# getFolder()
?Folder
# getImage()
?Image
# getFile()
?File
# getComments()
?Collection<FilenameComment>
# getShares()
?Collection<SharedFilename>
# 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.

# isContainedInFolder(Folder $folder)
bool
Check whether this filename is contained in the given folder or its subfolders

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 18

Read-only values on the record.

# path
string
Get the path for the filename including the folder. Does not escape forbidden characters by default.
# extension
?string
Get the extension for this filename
# content
File
Get the content available at the filename
# id
?int
# name
?string
# type
?string
# created
?DateTime
Get the date the record was created.
# modified
?DateTime
Get the last modification date for the record.
# hidden
?DateTime
# hidden
bool
# expires
?DateTime
# expiring
bool
Returns if expire date is set for a filename
# expired
bool
Returns if expire date (if it is set) has come
# folder
?Folder
# image
?Image
# file
?File

Admin view

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

Properties 21

Take no arguments.

# getPath()
string
Get the path for the filename including the folder. Does not escape forbidden characters by default.
# getExtension()
?string
Get the extension for this filename
# getContent()
File
Get the content available at the filename
# getId()
?int
# getName()
?string
# getType()
?string
# getCreated()
?DateTime
Get the date the record was created.
# getModified()
?DateTime
Get the last modification date for the record.
# getHidden()
?DateTime
# isHidden()
bool
# getExpires()
?DateTime
# isExpiring()
bool
Returns if expire date is set for a filename
# isExpired()
bool
Returns if expire date (if it is set) has come
# getFolder()
?Folder
# getImage()
?Image
# getFile()
?File
# getComments()
?Collection<FilenameComment>
# getShares()
?Collection<SharedFilename>
# 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.

# isContainedInFolder(Folder $folder)
bool
Check whether this filename is contained in the given folder or its subfolders