Documentation

BehaviorInterface

An AfformBehavior is a collection of configuration and functionality for an entity on a form.

Note: Rather than implementing this interface directly, extend the AbstractBehavior class.

Table of Contents

Methods

getDefaultMode()  : string|null
Default mode. If set then mode will not be de-selectable.
getDescription()  : string|null
Optional description of the behavior
getEntities()  : array<string|int, mixed>
Return list of supported Afform entities (e.g. Individual, Household...)
getKey()  : string
Dashed name, name of entity attribute for selected mode
getModes()  : array<string|int, mixed>
Get array of modes for a given entity
getTemplate()  : string|null
Optional template for configuring the behavior in the AfformGuiEditor
getTitle()  : string
Title of the behavior

Methods

getDefaultMode()

Default mode. If set then mode will not be de-selectable.

public static getDefaultMode() : string|null
Return values
string|null

getDescription()

Optional description of the behavior

public static getDescription() : string|null
Return values
string|null

getEntities()

Return list of supported Afform entities (e.g. Individual, Household...)

public static getEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>

getKey()

Dashed name, name of entity attribute for selected mode

public static getKey() : string
Return values
string

getModes()

Get array of modes for a given entity

public static getModes(string $entityName) : array<string|int, mixed>

The mode determines whether this behavior is enabled and what it should do

Parameters
$entityName : string

Only matters if this behavior supports multiple entities and if the modes are different

Return values
array<string|int, mixed>

getTemplate()

Optional template for configuring the behavior in the AfformGuiEditor

public static getTemplate() : string|null
Return values
string|null

getTitle()

Title of the behavior

public static getTitle() : string
Return values
string

        
On this page

Search results