Library/BranchManager.php
public function addBranch(Branch $branch)
    {
        if ($this->currentBranch) {
            $branch->setParentBranch($this->currentBranch);
            $this->currentBranch = $branch;
        } else {
            $this->currentBranch = $branch;
        }

        $branch->setUniqueId($this->uniqueId);
        $branch->setLevel($this->level);

        ++$this->level;
        ++$this->uniqueId;

        if (Branch::TYPE_ROOT == $branch->getType()) {
            $this->setRootBranch($branch);
        }
    }
public function addBranch(Branch $branch)
    {
        if ($this->currentBranch) {
            $branch->setParentBranch($this->currentBranch);
            $this->currentBranch = $branch;
        } else {
            $this->currentBranch = $branch;
        }

        $branch->setUniqueId($this->uniqueId);
        $branch->setLevel($this->level);

        ++$this->level;
        ++$this->uniqueId;

        if (Branch::TYPE_ROOT == $branch->getType()) {
            $this->setRootBranch($branch);
        }
    }
public function addBranch ( Branch $ branch ) { if ( $ this -> currentBranch ) { $ branch -> setParentBranch ( $ this -> currentBranch ) ; $ this -> currentBranch = $ branch ; } else { $ this -> currentBranch = $ branch ; } $ branch -> setUniqueId ( $ this -> uniqueId ) ; $ branch -> setLevel ( $ this -> level ) ; ++ $ this -> level ; ++ $ this -> uniqueId ; if ( Branch :: TYPE_ROOT == $ branch -> getType ( ) ) { $ this -> setRootBranch ( $ branch ) ; } }
Sets the current active branch in the manager.

@param Branch $branch
Sets the current active branch in the manager .