ModelWorkflows module

RevisionBranch

A model in the Workflows module, with 24 members for templates, 19 API properties and 25 members for admin templates.

Workflows\Models\Frontend\RevisionBranch Workflows\Models\Api\RevisionBranch Workflows\Models\Backend\RevisionBranch Also in Workflows: BranchApproval BranchComment BranchTransition Step Target Transition Workflow
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 22

Take no arguments.

# getStepColor()
string
Get the color for the current step the branch is in
# getStepName()
string
Get the name for the current step the branch is in
# getRecord()
?Model
Get the record associated with the branch
# getLastRevision()
?Revision
Get the last revision of the branch Resolved via an ORDER BY id DESC LIMIT 1 query — reading it from the record's revisions collection would hydrate every revision of the record.
# getNumRevisions()
int
Get the number of revisions in this branch (COUNT query — does not hydrate)
# getTranslatedEntityName()
string
Get the translated entity name for the branch, or the custom entity definition name if defined
# getAvailableTransitions()
array
Get the possible transitions available for this branch
# isAllowingChanges()
bool
Check if the record may be edited in the current workflow step of this branch
# getId()
?int
# getName()
?string
# getEntity()
?string
# getRecordId()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCurrentStep()
?Step
# getWorkflow()
?Workflow
# getComments()
?Collection<BranchComment>
# getTransitions()
?Collection<BranchTransition>
# getApprovals()
?Collection<BranchApproval>
# 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.

# isTransitionApproved(Transition $transition)
bool
Checks whether the transition can be done due to branch approvals
# getRevisions(?int $limit, ?int $offset)
?Collection
Get the revisions for the record associated with this branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a branch with a large history exhausts memory.

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 19

Read-only values on the record.

# stepColor
string
Get the color for the current step the branch is in
# stepName
string
Get the name for the current step the branch is in
# record
?Model
Get the record associated with the branch
# lastRevision
?Revision
Get the last revision of the branch Resolved via an ORDER BY id DESC LIMIT 1 query — reading it from the record's revisions collection would hydrate every revision of the record.
# numRevisions
int
Get the number of revisions in this branch (COUNT query — does not hydrate)
# translatedEntityName
string
Get the translated entity name for the branch, or the custom entity definition name if defined
# availableTransitions
array
Get the possible transitions available for this branch
# allowingChanges
bool
Check if the record may be edited in the current workflow step of this branch
# id
?int
# name
?string
# entity
?string
# recordId
?int
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# currentStep
?Step
# workflow
?Workflow
# transitions
?Collection<BranchTransition>

Admin view

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

Properties 23

Take no arguments.

# getStepColor()
string
Get the color for the current step the branch is in
# getStepName()
string
Get the name for the current step the branch is in
# getRecord()
?Model
Get the record associated with the branch
# getLastRevision()
?Revision
Get the last revision of the branch Resolved via an ORDER BY id DESC LIMIT 1 query — reading it from the record's revisions collection would hydrate every revision of the record.
# getNumRevisions()
int
Get the number of revisions in this branch (COUNT query — does not hydrate)
# getTranslatedEntityName()
string
Get the translated entity name for the branch, or the custom entity definition name if defined
# getAvailableTransitions()
array
Get the possible transitions available for this branch
# isAllowingChanges()
bool
Check if the record may be edited in the current workflow step of this branch
# getId()
?int
# getName()
?string
# getEntity()
?string
# getRecordId()
?int
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCurrentStep()
?Step
# getWorkflow()
?Workflow
# getComments()
?Collection<BranchComment>
# getTransitions()
?Collection<BranchTransition>
# getApprovals()
?Collection<BranchApproval>
# 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
# getTransitionsApprovals() Admin only
array
Get the approvals for all possible transitions for the current step of this branch

Methods 2

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

# isTransitionApproved(Transition $transition)
bool
Checks whether the transition can be done due to branch approvals
# getRevisions(?int $limit, ?int $offset)
?Collection
Get the revisions for the record associated with this branch, ordered by id ascending. Pass a limit/offset to fetch a bounded window instead of the full set — loading all revisions of a branch with a large history exhausts memory.