AfformEntitySortEvent
extends AfformBaseEvent
in package
This event allows listeners to declare that entities depend on others.
These dependencies change the order in which entities are resolved.
Table of Contents
Properties
- $hookFields : array<string|int, mixed>
- $hookFieldsFlip : array<string|int, mixed>
- $hookValues : array<string|int, mixed>
- $afform : array<string|int, mixed>
- $apiRequest : AbstractAction
- $BLACKLIST : array<string|int, mixed>
- List of field names that are prohibited due to conflicts in the class-hierarchy.
- $dependencies : mixed
- $formDataModel : FormDataModel
- $returnValues : mixed
- Some legacy hooks expect listener-functions to return a value.
Methods
- __construct() : mixed
- AfformBaseEvent constructor.
- __get() : mixed
- __isset() : mixed
- __set() : mixed
- __unset() : mixed
- addDependency() : void
- addReturnValues() : GenericHookEvent
- create() : GenericHookEvent
- Create a GenericHookEvent using key-value pairs.
- createOrdered() : GenericHookEvent
- Create a GenericHookEvent using ordered parameters.
- getAfform() : array<string|int, mixed>
- getApiRequest() : AbstractAction
- getFormDataModel() : FormDataModel
- getHookValues() : array<string|int, mixed>
- getReturnValues() : mixed
- getSortedEnties() : array<string|int, mixed>
- Returns entity names sorted by their dependencies
- hasField() : bool
- Determine whether the hook supports the given field.
- assertValidHookFields() : mixed
Properties
$hookFields
protected
array<string|int, mixed>
$hookFields
Ex: array(0 => 'contactID', 1 => 'contentPlacement').
$hookFieldsFlip
protected
array<string|int, mixed>
$hookFieldsFlip
Ex: array('contactID' => 0, 'contentPlacement' => 1).
$hookValues
protected
array<string|int, mixed>
$hookValues
Ex: array(0 => &$contactID, 1 => &$contentPlacement).
$afform
private
array<string|int, mixed>
$afform
The main 'Afform' record/configuration.
$apiRequest
private
AbstractAction
$apiRequest
$BLACKLIST
List of field names that are prohibited due to conflicts in the class-hierarchy.
private
static array<string|int, mixed>
$BLACKLIST
= ['name', 'dispatcher', 'propagationStopped', 'hookBlacklist', 'hookValues', 'hookFields', 'hookFieldsFlip']
$dependencies
private
mixed
$dependencies
= []
$formDataModel
private
FormDataModel
$formDataModel
$returnValues
Some legacy hooks expect listener-functions to return a value.
private
mixed
$returnValues
= []
OOP listeners may set the $returnValue.
This field is not recommended for use in new hooks. The return-value convention is not portable across different implementations of the hook system. Instead, it's more portable to provide an alterable, named field.
Methods
__construct()
AfformBaseEvent constructor.
public
__construct(array<string|int, mixed> $afform, FormDataModel $formDataModel, AbstractAction $apiRequest) : mixed
Parameters
- $afform : array<string|int, mixed>
- $formDataModel : FormDataModel
- $apiRequest : AbstractAction
__get()
public
& __get(mixed $name) : mixed
Parameters
- $name : mixed
Tags
__isset()
public
__isset(mixed $name) : mixed
Parameters
- $name : mixed
Tags
__set()
public
__set(mixed $name, mixed $value) : mixed
Parameters
- $name : mixed
- $value : mixed
Tags
__unset()
public
__unset(mixed $name) : mixed
Parameters
- $name : mixed
Tags
addDependency()
public
addDependency(string $dependentEntity, string $dependsOnEntity) : void
Parameters
- $dependentEntity : string
- $dependsOnEntity : string
addReturnValues()
public
addReturnValues(mixed $fResult) : GenericHookEvent
Parameters
- $fResult : mixed
Return values
GenericHookEventcreate()
Create a GenericHookEvent using key-value pairs.
public
static create(array<string|int, mixed> $params) : GenericHookEvent
Parameters
- $params : array<string|int, mixed>
-
Ex: array('contactID' => &$contactID, 'contentPlacement' => &$contentPlacement).
Return values
GenericHookEventcreateOrdered()
Create a GenericHookEvent using ordered parameters.
public
static createOrdered(array<string|int, mixed> $hookFields, array<string|int, mixed> $hookValues) : GenericHookEvent
Parameters
- $hookFields : array<string|int, mixed>
-
Ex: array(0 => 'contactID', 1 => 'contentPlacement').
- $hookValues : array<string|int, mixed>
-
Ex: array(0 => &$contactID, 1 => &$contentPlacement).
Return values
GenericHookEventgetAfform()
public
getAfform() : array<string|int, mixed>
Return values
array<string|int, mixed>getApiRequest()
public
getApiRequest() : AbstractAction
Return values
AbstractActiongetFormDataModel()
public
getFormDataModel() : FormDataModel
Return values
FormDataModelgetHookValues()
public
getHookValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —Ex: array(0 => &$contactID, 1 => &$contentPlacement).
getReturnValues()
public
getReturnValues() : mixed
getSortedEnties()
Returns entity names sorted by their dependencies
public
getSortedEnties() : array<string|int, mixed>
Return values
array<string|int, mixed>hasField()
Determine whether the hook supports the given field.
public
hasField(string $name) : bool
The field may or may not be empty. Use isset() or empty() to check that.
Parameters
- $name : string
Return values
boolassertValidHookFields()
private
static assertValidHookFields(array<string|int, mixed> $fields) : mixed
Parameters
- $fields : array<string|int, mixed>
-
List of field names.