ModelHooks module

Hook

A model in the Hooks module, with 23 members for templates, 20 API properties and 37 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 23

Take no arguments.

# getScheduledEvents()
Collection
Get the scheduled events / tasks for this hook
# getRecurringEvent()
?Task
Get the recurring event for this hook
# getAgentActionId()
?int
Id of the first agent action on this hook, or null when the hook has none. Resolved once per model instance: the admin batch listing asks this question for every row it renders, and the hook model is object-cached, so the actions scan runs once per distinct hook rather than once per batch. Loop-contained actions are covered — every action carries the hook FK regardless of nesting.
# hasAgentAction()
bool
Whether this hook runs an AI agent
# getId()
?int
# getName()
?string
# getText()
?string
# isSynchronous()
?bool
# getBatchPersistence()
?string
# getCreated()
?DateTime
# getModified()
?DateTime
# getCreatedBy()
?User
# getModifiedBy()
?User
# getPublished()
?DateTime
# isPublished()
bool
# getCategory()
?Category
# getSite()
?Site
# getActions()
?Collection<BaseAction>
# getEntityEvents()
?Collection<EntityEvent>
# getWebEvents()
?Collection<WebEvent>
# 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 20

Read-only values on the record.

# scheduledEvents
Collection
Get the scheduled events / tasks for this hook
# recurringEvent
?Task
Get the recurring event for this hook
# agentActionId
?int
Id of the first agent action on this hook, or null when the hook has none. Resolved once per model instance: the admin batch listing asks this question for every row it renders, and the hook model is object-cached, so the actions scan runs once per distinct hook rather than once per batch. Loop-contained actions are covered — every action carries the hook FK regardless of nesting.
# agentAction
bool
Whether this hook runs an AI agent
# id
?int
# name
?string
# text
?string
# synchronous
?bool
# batchPersistence
?string
# created
?DateTime
# modified
?DateTime
# createdBy
?User
# modifiedBy
?User
# published
?DateTime
# published
bool
# category
?Category
# site
?Site
# actions
?Collection<BaseAction>
# entityEvents
?Collection<EntityEvent>
# webEvents
?Collection<WebEvent>

Admin view

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

Properties 37

Take no arguments.

# getScheduledEvents()
Collection
Get the scheduled events / tasks for this hook
# getRecurringEvent()
?Task
Get the recurring event for this hook
# getAgentActionId()
?int
Id of the first agent action on this hook, or null when the hook has none. Resolved once per model instance: the admin batch listing asks this question for every row it renders, and the hook model is object-cached, so the actions scan runs once per distinct hook rather than once per batch. Loop-contained actions are covered — every action carries the hook FK regardless of nesting.
# hasAgentAction()
bool
Whether this hook runs an AI agent
# getId()
?int
# getName()
?string
# getText()
?string
# isSynchronous()
?bool
# getBatchPersistence()
?string
# getCreated()
?DateTime
# getModified()
?DateTime
# getCreatedBy()
?User
# getModifiedBy()
?User
# getPublished()
?DateTime
# isPublished()
bool
# getCategory()
?Category
# getSite()
?Site
# getActions()
?Collection<BaseAction>
# getEntityEvents()
?Collection<EntityEvent>
# getWebEvents()
?Collection<WebEvent>
# 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
# getAvailableEntities() Admin only
array
Get the available entities for entity events
# getAvailableBatchPersistenceOptions() Admin only
array
Get the available batch persistence values
# getConfiguredEntities() Admin only
array
Get a list of entities this hook is configured to react on
# getEventsDisplay() Admin only
string
Get a displayable version of the configured events for this hook
# getAvailableWebEventMethods() Admin only
array
Get the event methods to display
# getAvailableActionTypes() Admin only
array
Get the available action types for adding actions
# getActionsCount() Admin only
int
Get the number of actions for this hook.
# getBatchesCount() Admin only
int
Get the number of batches for this hook.
# getDuplicateUrl() Admin only
?string
Get the url for duplicating the record.
# getEditUrl() Admin only
?string
Get the url for editing the record.
# getDeleteUrl() Admin only
?string
Get the url for deleting the record.
# getPublishUrl() Admin only
?string
Get the url for publishing the record.
# getManageUrl() Admin only
?string
Get the url for managing records.