ModelHooks module

WebBatchEvent

Batch event containing information about the web event that issued the hook

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

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 18

Take no arguments.

# getType()
string
Get the type of the event causing the hook execution. Always returns 'web' for web events.
# getDataDisplay()
string
Get a string representation the source hook and action for this batch event
# getWebEvent()
?WebEvent
Get the web event that triggered this batch
# getQueryParameters()
array
Get the query parameters for the called web event
# getPathParameters()
array
Get the path parameters (e.g. everything after the slug, seperated by slash) from the called event
# getHeaders()
array
Get the headers sent with the call to the web event
# getBody()
string
Get the body sent with the call to the web event
# getContentType()
string
Get the content type from the web event call
# getBodyData()
ReadOnlyCollection
Get the body data for this web event call with content-type was application/json. Returns the data in array form if it was submitted as JSON or Form encoded.
# getMethod()
string
Get the HTTP method used when calling the web event
# getTypeDisplay()
string
Get a string representation of the batch event based on its type
# getId()
?int
# getCreated()
?DateTime
Date the record was created.
# getCreatedBy()
?User
Get the user that triggered the event
# getBatch()
?Batch
# 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 2

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

# getQueryParameter(string $key)
?mixed
Get the query parameter with the specified key
# getHeader(string $key)
?mixed
Get the header with the specified key

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 15

Read-only values on the record.

# type
string
Get the type of the event causing the hook execution. Always returns 'web' for web events.
# dataDisplay
string
Get a string representation the source hook and action for this batch event
# webEvent
?WebEvent
Get the web event that triggered this batch
# queryParameters
array
Get the query parameters for the called web event
# pathParameters
array
Get the path parameters (e.g. everything after the slug, seperated by slash) from the called event
# headers
array
Get the headers sent with the call to the web event
# body
string
Get the body sent with the call to the web event
# contentType
string
Get the content type from the web event call
# bodyData
ReadOnlyCollection
Get the body data for this web event call with content-type was application/json. Returns the data in array form if it was submitted as JSON or Form encoded.
# method
string
Get the HTTP method used when calling the web event
# typeDisplay
string
Get a string representation of the batch event based on its type
# id
?int
# created
?DateTime
Date the record was created.
# createdBy
?User
Get the user that triggered the event
# batch
?Batch

Admin view

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

Properties 18

Take no arguments.

# getType()
string
Get the type of the event causing the hook execution. Always returns 'web' for web events.
# getDataDisplay()
string
Get a string representation the source hook and action for this batch event
# getWebEvent()
?WebEvent
Get the web event that triggered this batch
# getQueryParameters()
array
Get the query parameters for the called web event
# getPathParameters()
array
Get the path parameters (e.g. everything after the slug, seperated by slash) from the called event
# getHeaders()
array
Get the headers sent with the call to the web event
# getBody()
string
Get the body sent with the call to the web event
# getContentType()
string
Get the content type from the web event call
# getBodyData()
ReadOnlyCollection
Get the body data for this web event call with content-type was application/json. Returns the data in array form if it was submitted as JSON or Form encoded.
# getMethod()
string
Get the HTTP method used when calling the web event
# getTypeDisplay()
string
Get a string representation of the batch event based on its type
# getId()
?int
# getCreated()
?DateTime
Date the record was created.
# getCreatedBy()
?User
Get the user that triggered the event
# getBatch()
?Batch
# 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 2

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

# getQueryParameter(string $key)
?mixed
Get the query parameter with the specified key
# getHeader(string $key)
?mixed
Get the header with the specified key