PreSaveSubscriber
extends AbstractPrepareSubscriber
in package
AbstractYes
AutoService is a base-class for defining a service (in Civi's service-container).
Table of Contents
Properties
- $supportedOperation : string
Methods
- getSubscribedEvents() : array<string|int, mixed>
- onApiPrepare() : mixed
- applies() : bool
- Check if this subscriber should be applied to the request
- modify() : mixed
- Modify the item about to be saved
Properties
$supportedOperation
public
string
$supportedOperation
= 'both'
create|update|both
Methods
getSubscribedEvents()
public
static getSubscribedEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>onApiPrepare()
public
onApiPrepare(PrepareEvent $event) : mixed
Parameters
- $event : PrepareEvent
applies()
Check if this subscriber should be applied to the request
protected
abstract applies(AbstractAction $request) : bool
Parameters
- $request : AbstractAction
Return values
boolmodify()
Modify the item about to be saved
protected
abstract modify(array<string|int, mixed> &$item, AbstractAction $request) : mixed
Parameters
- $item : array<string|int, mixed>
- $request : AbstractAction