Skip to content

Commit

Permalink
Redesign: now keeping IDs within the object
Browse files Browse the repository at this point in the history
  • Loading branch information
esokullu committed May 12, 2017
1 parent 327a6cd commit 2527b78
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.1
3.4.0
1 change: 1 addition & 0 deletions src/Pho/Framework/Actor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Actor extends \Pho\Lib\Graph\Node implements ParticleInterface {
public function __construct(ContextInterface $context) {
parent::__construct($context);
$this->creator = $this;
$this->creator_id = $creator->id();
$this->enter($context);
$this->setupEdges();
}
Expand Down
1 change: 1 addition & 0 deletions src/Pho/Framework/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Frame extends \Pho\Lib\Graph\SubGraph implements ParticleInterface, Contex
public function __construct(Actor $creator, ContextInterface $context) {
parent::__construct($context);
$this->creator = $creator;
$this->creator_id = $creator->id();
$this->setupEdges();
}

Expand Down
1 change: 1 addition & 0 deletions src/Pho/Framework/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Object extends \Pho\Lib\Graph\Node implements ParticleInterface {
public function __construct(Actor $creator, ContextInterface $context) {
parent::__construct($context);
$this->creator = $creator;
$this->creator_id = $creator->id();
$this->setupEdges();
}

Expand Down
10 changes: 9 additions & 1 deletion src/Pho/Framework/ParticleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ trait ParticleTrait {
*/
protected $creator;


/**
* The creator's ID
*
* @var string
*/
protected $creator_id;

/**
* @internal
*
Expand Down Expand Up @@ -284,7 +292,7 @@ protected function _callGetter(string $name, array $args): array
public function toArray(): array
{
$array = parent::toArray();
$array["creator"] = $this->creator->id();
$array["creator"] = $this->creator_id;
return $array;
}

Expand Down

0 comments on commit 2527b78

Please sign in to comment.