\Phabstractic\Event\ResourceEventInterface

Event Interface - Defines basic event functionality

This interface 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 implement this interface.

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: reformatted for invlusion in phabstractic - July 29th, 2016

Summary

Methods
Constants
getState()
setState()
setStateWithEvent()
setStateWithArray()
getIdentifier()
getCategories()
addCategory()
setCategories()
removeCategory()
isCategory()
getTags()
addTag()
setTags()
removeTag()
isTag()
getTarget()
getTargetReference()
setTarget()
setTargetReference()
getData()
getDataReference()
setData()
setDataReference()
getFunction()
getClass()
getNamespace()
stop()
proceed()
isStopped()
force()
subdue()
isUnstoppable()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getState()

getState() : mixed

State Interface Status Get

Returns

mixed

setState()

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.

Parameters

$state

setStateWithEvent()

setStateWithEvent(\Phabstractic\Event\Resource\Phabstractic\Event\Resource\EventInterface  $event, 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.

Parameters

\Phabstractic\Event\Resource\Phabstractic\Event\Resource\EventInterface $event

The state information encapsulated in an object

boolean $morph

Whether we should replace or overwrite the object state

setStateWithArray()

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.

Parameters

array $state
boolean $morph

Whether we should replace or overwrite the object state

getIdentifier()

getIdentifier() : mixed

Retrieve the event identifier

Returns

mixed

getCategories()

getCategories() : array

Return the categories of the event

NOTE: This returns an array

Returns

array

addCategory()

addCategory(  $category) 

Add a category to the event

Parameters

$category

setCategories()

setCategories(array  $categories) 

Set a bunch of categories at once

Parameters

array $categories

removeCategory()

removeCategory(  $category) 

Remove a category from the event

Parameters

$category

isCategory()

isCategory(  $category) : boolean

Does this event have a particular category?

Parameters

$category

Returns

boolean

getTags()

getTags() : array

Get the tags associated with this event

NOTE: This returns an array

Returns

array

addTag()

addTag(string  $tag) 

Associate a tag with this event

Parameters

string $tag

setTags()

setTags(array  $tags) 

Set a bunch of tags to be associated with this event

Parameters

array $tags

removeTag()

removeTag(string  $tag) 

Dissasociate a particular tag from this event

Parameters

string $tag

isTag()

isTag(string  $tag) : boolean

Is a tag associated with this particular event

Parameters

string $tag

Returns

boolean

getTarget()

getTarget() : object

Returns the generator of the event

Returns

object

getTargetReference()

getTargetReference() : object

Returns the generator of the event's reference

Returns

object

setTarget()

setTarget(  $target) 

Sets the generator of the event

NOTE: Use this function out of the construction of an event with caution

Parameters

$target

setTargetReference()

setTargetReference(  $target) 

Sets the generator of the event's reference

Parameters

$target

getData()

getData() : mixed

Retrieve the data associated with the event

Returns

mixed

getDataReference()

getDataReference() : mixed

Retrieve the data associated with the event as a reference

Returns

mixed

setData()

setData(mixed  $data) 

Set the data associated with the event

This is implementation specific

Parameters

mixed $data

setDataReference()

setDataReference(mixed  $data) 

Set the data associated with the event as a reference

This is implementation specific

Parameters

mixed $data

getFunction()

getFunction() : string

Retrieve the event originating function

Returns

string

getClass()

getClass() : string

Retrieve the event originating class

Returns

string

getNamespace()

getNamespace() : string

Retrieve the event originating namespace

Returns

string

stop()

stop() 

Stop propagation of the event

This member is checked by the filters

proceed()

proceed() 

Allow the event to continue propogating

isStopped()

isStopped() : boolean

Has the propogation of this event stopped?

Returns

boolean

force()

force() 

Make this event unstoppable

subdue()

subdue() 

Make this event stoppable

isUnstoppable()

isUnstoppable() : boolean

Is this event unstoppable?

Checked by filters

Returns

boolean