src/Franzose/ClosureTable/Models/Entity.php
public function addChild(EntityInterface $child, $position = null, $returnChild = false)
    {
        if ($this->exists) {
            if (is_null($position)) {
                $position = $this->getNextAfterLastPosition($this->getKey());
            }

            $child->moveTo($position, $this);
        }

        return ($returnChild === true ? $child : $this);
    }
public function addChild(EntityInterface $child, $position = null, $returnChild = false)
    {
        if ($this->exists) {
            if (is_null($position)) {
                $position = $this->getNextAfterLastPosition($this->getKey());
            }

            $child->moveTo($position, $this);
        }

        return ($returnChild === true ? $child : $this);
    }
public function addChild ( EntityInterface $ child , $ position = null , $ returnChild = false ) { if ( $ this -> exists ) { if ( is_null ( $ position ) ) { $ position = $ this -> getNextAfterLastPosition ( $ this -> getKey ( ) ) ; } $ child -> moveTo ( $ position , $ this ) ; } return ( $ returnChild === true ? $ child : $ this ) ; }
Appends a child to the model.

@param EntityInterface $child
@param int $position
@param bool $returnChild
@return EntityInterface
Appends a child to the model .