ModelFiles module

VirtualFile

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

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

Take no arguments.

# getVirtualFilePath()
string
Get the full virtual file path. Returns an empty string if the file was not found and logs an error.
# getContent()
string
Get the raw content of the file. Returns an empty string if the file was not found and logs an error.
# getId()
?int
# getMd5()
?string
# getType()
?string
# getSize()
?int
# getVirtualFilename()
?string
# getCreated()
?DateTime
Get the date the record was created.
# 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

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 8

Read-only values on the record.

# virtualFilePath
string
Get the full virtual file path. Returns an empty string if the file was not found and logs an error.
# content
string
Get the raw content of the file. Returns an empty string if the file was not found and logs an error.
# id
?int
# md5
?string
# type
?string
# size
?int
# virtualFilename
?string
# created
?DateTime
Get the date the record was created.

Admin view

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

Properties 11

Take no arguments.

# getVirtualFilePath()
string
Get the full virtual file path. Returns an empty string if the file was not found and logs an error.
# getContent()
string
Get the raw content of the file. Returns an empty string if the file was not found and logs an error.
# getId()
?int
# getMd5()
?string
# getType()
?string
# getSize()
?int
# getVirtualFilename()
?string
# getCreated()
?DateTime
Get the date the record was created.
# 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