ModelAgents module

Recommendation

A model in the Agents module, with 34 members for templates, 30 API properties and 34 members for admin templates.

Agents\Models\Frontend\Recommendation Agents\Models\Api\Recommendation Agents\Models\Backend\Recommendation Also in Agents: Escalation Install Invocation
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 33

Take no arguments.

# isPending()
bool
Whether the recommendation is still awaiting a human decision.
# isTerminal()
bool
Whether the recommendation reached a terminal state and is no longer actionable.
# isApplied()
bool
Whether the recommendation has been applied to its target (manually or automatically).
# isApplicable()
bool
Whether the recommendation carries an applicable change (a target field plus a proposed value). read_only recommendations may carry neither.
# getConfidenceFloat()
?float
The confidence as a float in [0, 1], or null when none was recorded.
# getProposedChange()
?mixed
The value the agent proposes to write, unwrapped from the storage envelope ({"value": …, "previous": …}). Exposed so API consumers and the diff view need not know the envelope layout. Null when the recommendation carries no change.
# getPreviousValue()
?mixed
The target field's value being replaced, unwrapped from the storage envelope. Null when no previous value was captured (e.g. a not-yet-applied recommendation).
# getBaselineValue()
?mixed
The target field's value as it stood when the agent proposed the change, unwrapped from the storage envelope. Null when no baseline was captured — a recommendation raised before the baseline was recorded, or one carrying no change.
# hasBaseline()
bool
Whether an emit-time baseline was captured for this recommendation. Distinct from a null baseline value, which is a legitimate captured state (the field was empty when the agent read it) and must not disable the apply-time drift check.
# isCurrentValueKnown()
bool
Whether a live target-field value has been read for this recommendation. Separates "the field is empty" from "the current value could not be read", which {@link getCurrentValue()} alone cannot — both come back as null.
# getCurrentValue()
?mixed
The target field's live value, or null when none was attached
# isDrifted()
bool
Whether the target field has moved away from the value it held when the agent proposed the change — i.e. accepting would overwrite an edit made since. Reports false whenever the question cannot be answered (no baseline captured, no live value attached) rather than guessing, so the inbox never shows a conflict warning it cannot substantiate.
# getTargetLabel()
string
Short, human-friendly target label (entity short name + id), e.g. "Page #42".
# getId()
?int
# getTitle()
?string
# getDescription()
?string
# getTargetEntity()
?string
# getTargetEntityId()
?int
# getTargetField()
?string
# getProposedValue()
?array
# getConfidence()
?string
# getStatus()
?string
# getAppliedAt()
?DateTime
# getAppliedBy()
?User
# getVetoExpiresAt()
?DateTime
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getSite()
?Site
# getAgentInvocation()
?Invocation
# getAgentInstall()
?Install
# 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.

# isVetoWindowExpired(DateTimeInterface $now)
bool
Whether the veto window has elapsed relative to the given moment (auto-apply eligibility). False when no veto window was set.

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 30

Read-only values on the record.

# pending
bool
Whether the recommendation is still awaiting a human decision.
# terminal
bool
Whether the recommendation reached a terminal state and is no longer actionable.
# applied
bool
Whether the recommendation has been applied to its target (manually or automatically).
# applicable
bool
Whether the recommendation carries an applicable change (a target field plus a proposed value). read_only recommendations may carry neither.
# confidenceFloat
?float
The confidence as a float in [0, 1], or null when none was recorded.
# proposedChange
?mixed
The value the agent proposes to write, unwrapped from the storage envelope ({"value": …, "previous": …}). Exposed so API consumers and the diff view need not know the envelope layout. Null when the recommendation carries no change.
# previousValue
?mixed
The target field's value being replaced, unwrapped from the storage envelope. Null when no previous value was captured (e.g. a not-yet-applied recommendation).
# baselineValue
?mixed
The target field's value as it stood when the agent proposed the change, unwrapped from the storage envelope. Null when no baseline was captured — a recommendation raised before the baseline was recorded, or one carrying no change.
# baseline
bool
Whether an emit-time baseline was captured for this recommendation. Distinct from a null baseline value, which is a legitimate captured state (the field was empty when the agent read it) and must not disable the apply-time drift check.
# currentValueKnown
bool
Whether a live target-field value has been read for this recommendation. Separates "the field is empty" from "the current value could not be read", which {@link getCurrentValue()} alone cannot — both come back as null.
# currentValue
?mixed
The target field's live value, or null when none was attached
# drifted
bool
Whether the target field has moved away from the value it held when the agent proposed the change — i.e. accepting would overwrite an edit made since. Reports false whenever the question cannot be answered (no baseline captured, no live value attached) rather than guessing, so the inbox never shows a conflict warning it cannot substantiate.
# targetLabel
string
Short, human-friendly target label (entity short name + id), e.g. "Page #42".
# id
?int
# title
?string
# description
?string
# targetEntity
?string
# targetEntityId
?int
# targetField
?string
# proposedValue
?array
# confidence
?string
# status
?string
# appliedAt
?DateTime
# appliedBy
?User
# vetoExpiresAt
?DateTime
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# site
?Site
# agentInvocation
?Invocation
# agentInstall
?Install

Admin view

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

Properties 33

Take no arguments.

# isPending()
bool
Whether the recommendation is still awaiting a human decision.
# isTerminal()
bool
Whether the recommendation reached a terminal state and is no longer actionable.
# isApplied()
bool
Whether the recommendation has been applied to its target (manually or automatically).
# isApplicable()
bool
Whether the recommendation carries an applicable change (a target field plus a proposed value). read_only recommendations may carry neither.
# getConfidenceFloat()
?float
The confidence as a float in [0, 1], or null when none was recorded.
# getProposedChange()
?mixed
The value the agent proposes to write, unwrapped from the storage envelope ({"value": …, "previous": …}). Exposed so API consumers and the diff view need not know the envelope layout. Null when the recommendation carries no change.
# getPreviousValue()
?mixed
The target field's value being replaced, unwrapped from the storage envelope. Null when no previous value was captured (e.g. a not-yet-applied recommendation).
# getBaselineValue()
?mixed
The target field's value as it stood when the agent proposed the change, unwrapped from the storage envelope. Null when no baseline was captured — a recommendation raised before the baseline was recorded, or one carrying no change.
# hasBaseline()
bool
Whether an emit-time baseline was captured for this recommendation. Distinct from a null baseline value, which is a legitimate captured state (the field was empty when the agent read it) and must not disable the apply-time drift check.
# isCurrentValueKnown()
bool
Whether a live target-field value has been read for this recommendation. Separates "the field is empty" from "the current value could not be read", which {@link getCurrentValue()} alone cannot — both come back as null.
# getCurrentValue()
?mixed
The target field's live value, or null when none was attached
# isDrifted()
bool
Whether the target field has moved away from the value it held when the agent proposed the change — i.e. accepting would overwrite an edit made since. Reports false whenever the question cannot be answered (no baseline captured, no live value attached) rather than guessing, so the inbox never shows a conflict warning it cannot substantiate.
# getTargetLabel()
string
Short, human-friendly target label (entity short name + id), e.g. "Page #42".
# getId()
?int
# getTitle()
?string
# getDescription()
?string
# getTargetEntity()
?string
# getTargetEntityId()
?int
# getTargetField()
?string
# getProposedValue()
?array
# getConfidence()
?string
# getStatus()
?string
# getAppliedAt()
?DateTime
# getAppliedBy()
?User
# getVetoExpiresAt()
?DateTime
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getSite()
?Site
# getAgentInvocation()
?Invocation
# getAgentInstall()
?Install
# 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.

# isVetoWindowExpired(DateTimeInterface $now)
bool
Whether the veto window has elapsed relative to the given moment (auto-apply eligibility). False when no veto window was set.