\Pho\FrameworkSpace

The Space

This class is a shell to Pho\Lib\Graph's Graph implementation and it implements ContextInterface to give higher-level software access to use both Frame and Graph as context objects.

Summary

Methods
Properties
Constants
__construct()
id()
canEmitNodeAddSignals()
toArray()
on()
emit()
listeners()
removeAllListeners()
init()
add()
loadNodesFromArray()
loadNodesFromIDArray()
get()
contains()
remove()
members()
count()
in()
No public properties found
No constants found
graphToArray()
$emit_node_add_signal
$listeners
$listeners_flat
$nodes
$node_ids
$id_generator
N/A
No private methods found
No private properties found
N/A

Properties

$emit_node_add_signal

$emit_node_add_signal : boolean

Whether the graph and its subgraphs emit node addition.

Type

boolean

$listeners

$listeners : array

The list of listeners

Type

array

$listeners_flat

$listeners_flat : 

Type

$nodes

$nodes : array

Holds nodes in ID => NodeInterface format

Type

array

$node_ids

$node_ids : array

Holds node IDs only in string formt

Type

array

$id_generator

$id_generator : string

ID generator is now Framework's own ID class

Type

string

Methods

__construct()

__construct() 

Constructor.

Same as \Pho\Lib\Graph\Graph except node addition is strictly NOT emitted.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

id()

id() : \Pho\Lib\Graph\ID

Returns the ID of the Graph

Normally the Graph object does not have an ID but it is implemented it here so that the functions that query GraphInterface objects such as SubGraphs, which do have, IDs associated, will be easier to design.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

\Pho\Lib\Graph\ID

The ID

canEmitNodeAddSignals()

canEmitNodeAddSignals() 

{@inheritDoc}

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

toArray()

toArray() : array

Converts the object to array

Used for serialization/unserialization. Converts internal object properties into a simple format to help with reconstruction.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

array —

The object in array format.

on()

on(\Pho\Lib\Graph\Event\string  $eventName,   $callBack, \Pho\Lib\Graph\Event\int  $priority = 100) : void

Subscribe to an event.

Parameters

\Pho\Lib\Graph\Event\string $eventName
$callBack
\Pho\Lib\Graph\Event\int $priority
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

emit()

emit(\Pho\Lib\Graph\Event\string  $eventName, array  $arguments = array()) 

Emits an event.

This method will return true if 0 or more listeners were succesfully handled. false is returned if one of the events broke the event chain.

Pho: Please note, continueCallback does not exist with Pho

If the continueCallBack is specified, this callback will be called every time before the next event handler is called.

If the continueCallback returns false, event propagation stops. This allows you to use the eventEmitter as a means for listeners to implement functionality in your application, and break the event loop as soon as some condition is fulfilled.

Note that returning false from an event subscriber breaks propagation and returns false, but if the continue-callback stops propagation, this is still considered a 'successful' operation and returns true.

Lastly, if there are 5 event handlers for an event. The continueCallback will be called at most 4 times.

Parameters

\Pho\Lib\Graph\Event\string $eventName
array $arguments
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

listeners()

listeners(\Pho\Lib\Graph\Event\string  $eventName, \Pho\Lib\Graph\Event\bool  $flat = false) : array<mixed,callable>

Returns the list of listeners for an event.

The list is returned as an array, and the list of events are sorted by their priority.

Parameters

\Pho\Lib\Graph\Event\string $eventName
\Pho\Lib\Graph\Event\bool $flat
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

array<mixed,callable>

removeAllListeners()

removeAllListeners(\Pho\Lib\Graph\Event\string  $eventName = null) : void

Removes all listeners.

If the eventName argument is specified, all listeners for that event are removed. If it is not specified, every listener for every event is removed.

Parameters

\Pho\Lib\Graph\Event\string $eventName
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

init()

init() 

{@inheritDoc}

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

add()

add(\Pho\Lib\Graph\NodeInterface  $node, \Pho\Lib\Graph\bool  $skip_signals = false,   $active_exceptions = false) 

{@inheritdoc}

should be able to change context of $node if $node's context is

Parameters

\Pho\Lib\Graph\NodeInterface $node
\Pho\Lib\Graph\bool $skip_signals
$active_exceptions
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

loadNodesFromArray()

loadNodesFromArray(array  $nodes) 

{@inheritdoc}

Parameters

array $nodes
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

loadNodesFromIDArray()

loadNodesFromIDArray(array  $node_ids) 

{@inheritdoc}

Parameters

array $node_ids
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

get()

get(\Pho\Lib\Graph\ID  $node_id) 

{@inheritdoc}

Parameters

\Pho\Lib\Graph\ID $node_id
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

contains()

contains(\Pho\Lib\Graph\ID  $node_id) 

{@inheritdoc}

Parameters

\Pho\Lib\Graph\ID $node_id
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

remove()

remove(\Pho\Lib\Graph\ID  $node_id) 

{@inheritdoc}

Parameters

\Pho\Lib\Graph\ID $node_id
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

members()

members() 

{@inheritdoc}

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

count()

count() 

{@inheritdoc}

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

in()

in(\Pho\Framework\ContextInterface  $context) : boolean

Checks if the given context is contained by or equal to this graph.

Parameters

\Pho\Framework\ContextInterface $context
Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

boolean

graphToArray()

graphToArray() : array

Converts the object to array

Used for serialization/unserialization. Converts internal object properties into a simple format to help with reconstruction.

Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275 Warning: count(): Parameter must be an array or an object that implements Countable in phar:///Users/emresokullu/Code/website/phpdoc/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275

Returns

array —

The object in array format.