$identifier
$identifier : mixed
The event identifier
This is implementation specific
Abstract Event Class - Defines basic event functionality
This class defines the basic functionality and members that all events share. This serves as the universal event type checker. All recognizable event in the event system must inherit and implement this class.
Technically an event is an object 'state', when the state changes in a publisher, it's like 'triggering' an event.
CHANGELOG
1.0 Created Abstract Event - August 16th, 2013 2.0 Integrated into Primus2 - September 12th, 2015 3.0: inherit from eventinterface eliminated set/clear identifier changed --Object methods to --Set getState now returns arrays, not sets set state now employs top and force reformatted for inclusion in phabtractic - July 29th, 2016
__construct(object $target, string $function, string $class, string $namespace, mixed $data = null, array $tags = array(), array $categories = array())
The Abstract Event Constructor
This is implements an event, setting all the necessary fields
object | $target | The target of the event |
string | $function | The function/method generating the event |
string | $class | The class name generating the event if applicable |
string | $namespace | The namespace of the generating point |
mixed | $data | Any data associated with the event |
array | $tags | An array of strings associating the event with a set of tags |
array | $categories |
setState( $state)
State Interface Status Set
In an 'event' publisher/observer ecosystem, such as asherwunk/phabstractic/-/event:
Replaces the current state object's data. In order for the observer/publisher pattern to work it is recommended that the caller of this function notifies all observers of the host object.
$state |
setStateWithArray(array $state, boolean $morph = true)
This sets or morphs an event with new information
If morph is set, the event doesn't clear it's information, and instead overwrites whats already there.
$state must include identifier
array | $state | |
boolean | $morph | Whether we should replace or overwrite the object state |
setStateWithEvent(\Phabstractic\Event\Resource\EventInterface $state, boolean $morph = true)
This sets or morphs an event with new information
If morph is set, the event doesn't clear it's information, and instead overwrites whats already there.
\Phabstractic\Event\Resource\EventInterface | $state | |
boolean | $morph | Whether we should replace or overwrite the object state |