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

            $sibling->moveTo($position, $this->parent_id);
        }

        return ($returnSibling === true ? $sibling : $this);
    }
public function addSibling(EntityInterface $sibling, $position = null, $returnSibling = false)
    {
        if ($this->exists) {
            if (is_null($position)) {
                $position = $this->getNextAfterLastPosition();
            }

            $sibling->moveTo($position, $this->parent_id);
        }

        return ($returnSibling === true ? $sibling : $this);
    }
public function addSibling ( EntityInterface $ sibling , $ position = null , $ returnSibling = false ) { if ( $ this -> exists ) { if ( is_null ( $ position ) ) { $ position = $ this -> getNextAfterLastPosition ( ) ; } $ sibling -> moveTo ( $ position , $ this -> parent_id ) ; } return ( $ returnSibling === true ? $ sibling : $ this ) ; }
Appends a sibling within the current depth.

@param EntityInterface $sibling
@param int|null $position
@param bool $returnSibling
@return EntityInterface
Appends a sibling within the current depth .