\Pho\FrameworkParticleTrait

The Particle Trait

This constitutes the basis of all particle classes that are part of the Pho Framework; namely Actor, \Pho\Framework\Frame and Obj.

Pho Framework particles extend Pho\Lib\Graph\Node

Summary

Methods
Properties
Constants
registerIncomingEdges()
registerOutgoingEdges()
getRegisteredIncomingEdges()
getRegisteredOutgoingEdges()
registerHandler()
toArray()
existentials()
creator()
notifySubscribers()
exportCargo()
No public properties found
No constants found
initializeParticle()
initializeHandler()
autoRegisterOutgoingEdges()
addEdges()
$creator
$creator_id
$handler
$incoming_edges
$outgoing_edges
N/A
No private methods found
No private properties found
N/A
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

Properties

$creator

$creator : \Pho\Framework\Actor

Who created this node. Must point to an Actor.

Points to self by Actor particles.

Type

\Pho\Framework\Actor

$creator_id

$creator_id : string

The creator's ID

Type

string

$handler

$handler : \Pho\Framework\Handlers\Gateway

Handles catch-all method calls.

Type

\Pho\Framework\Handlers\Gateway

$incoming_edges

$incoming_edges : array

An array of incoming edge classes

Type

array

$outgoing_edges

$outgoing_edges : array

An array of outgoing edge classes

Type

array

Methods

registerIncomingEdges()

registerIncomingEdges(  $classes) : void

Registers the incoming edges.

The default ones for all nodes are:

  • ActorOut\Read::class
  • ActorOut\Subscribe::class
  • ObjOut\Publish::class

Parameters

$classes
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

registerOutgoingEdges()

registerOutgoingEdges(  $classes) : void

Registers the outgoing edges.

Parameters

$classes
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

getRegisteredIncomingEdges()

getRegisteredIncomingEdges() 

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

getRegisteredOutgoingEdges()

getRegisteredOutgoingEdges() 

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

registerHandler()

registerHandler(string  $key, string  $class) : void

Registers a new handler adapter.

Default handlers may be overriden.

Parameters

string $key

Adapter key; e.g. "get", "set", "form" etc.

string $class

Handler class to register. A handler class shall implement HandlerInterface

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 particle into array

For serialization and portability.

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

existentials()

existentials() 

{@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

creator()

creator() : \Pho\Framework\Actor

Retrieves the creator of this node.

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\Framework\Actor

notifySubscribers()

notifySubscribers(\Pho\Framework\AbstractNotification  $notification) : void

Sends notification to subscriber particles

Parameters

\Pho\Framework\AbstractNotification $notification
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

exportCargo()

exportCargo() : array

Returns all incoming edge, outgoing edge and field keywords.

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 —

An array of incoming edge / outgoing edge / field cargo

initializeParticle()

initializeParticle() : void

Initializes the particle.

Its functions include:

  • adding default incoming edges.
  • discovering outgoing edges based on directory structure
  • passing the ball to Handler initializer.
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

initializeHandler()

initializeHandler() : void

A helper method to set up edges and fields.

Its inner functions can be summarized as:

1) Uses the Loaders to

  • examine the class structures (the constants, registered edges etc) and find out incoming and outgoing edges as well as fields. 2) Load the results into Cargo objects 3) Deploy the cargo objects back into this object so that the handler can serve method calls.
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

autoRegisterOutgoingEdges()

autoRegisterOutgoingEdges() : void

Auto-registers outgoing edge classes

Auto-registration is done by directory structure. Directories that sit in this folder, and are named after this class with "Out" suffix (such as "MyNodeOut" for a node class named "MyNode") would be candidate for auto-registration.

Please note, this does not check if it's actually an Edge class. The check is done by the OutgoingEdgeLoader class.

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

addEdges()

addEdges(string  $direction,   $classes) : self

A helper method to register edges

Parameters

string $direction

Either incoming or outgoing

$classes
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

self