protected function createSubAggregate($entity, string $relation): self
    {
        // If root isn't defined, then this is the Aggregate Root
        $root = is_null($this->root) ? $this : $this->root;

        return new self($entity, $this, $relation, $root);
    }
protected function createSubAggregate($entity, string $relation): self
    {
        // If root isn't defined, then this is the Aggregate Root
        $root = is_null($this->root) ? $this : $this->root;

        return new self($entity, $this, $relation, $root);
    }
protected function createSubAggregate ( $ entity , string $ relation ) : self { // If root isn't defined, then this is the Aggregate Root $ root = is_null ( $ this -> root ) ? $ this : $ this -> root ; return new self ( $ entity , $ this , $ relation , $ root ) ; }
Create a related subAggregate.

@param mixed  $entity
@param string $relation

@throws MappingException

@return Aggregate
Create a related subAggregate .