public function registerAggregateRootCallback($aggregateRoot, $child, callable $function)
    {
        $childObjectHashId = $this->getObjectHashId($child);

        if (!isset($this->aggregateRootChildren[$childObjectHashId])) {
            $this->aggregateRootChildren[$childObjectHashId] = [];
        }

        $this->aggregateRootChildren[$childObjectHashId][] = [
            "aggregateRoot" => $aggregateRoot,
            "child"         => $child,
            "function"      => $function,
        ];
    }
public function registerAggregateRootCallback($aggregateRoot, $child, callable $function)
    {
        $childObjectHashId = $this->getObjectHashId($child);

        if (!isset($this->aggregateRootChildren[$childObjectHashId])) {
            $this->aggregateRootChildren[$childObjectHashId] = [];
        }

        $this->aggregateRootChildren[$childObjectHashId][] = [
            "aggregateRoot" => $aggregateRoot,
            "child"         => $child,
            "function"      => $function,
        ];
    }
public function registerAggregateRootCallback ( $ aggregateRoot , $ child , callable $ function ) { $ childObjectHashId = $ this -> getObjectHashId ( $ child ) ; if ( ! isset ( $ this -> aggregateRootChildren [ $ childObjectHashId ] ) ) { $ this -> aggregateRootChildren [ $ childObjectHashId ] = [ ] ; } $ this -> aggregateRootChildren [ $ childObjectHashId ] [ ] = [ "aggregateRoot" => $ aggregateRoot , "child" => $ child , "function" => $ function , ] ; }
Registers a function to set the aggregate root Id in a child entity after the aggregate root has been inserted
Since the child depends on the aggregate root's Id being set, make sure the root is inserted before the child

@param   object   $aggregateRoot The aggregate root
@param   object   $child         The child of the aggregate root
@param   callable $function      The function that contains the logic to set the aggregate root Id in the child

@return  void
Registers a function to set the aggregate root Id in a child entity after the aggregate root has been inserted Since the child depends on the aggregate root s Id being set make sure the root is inserted before the child