本文整理匯總了PHP中Branch::setLevel方法的典型用法代碼示例。如果您正苦於以下問題:PHP Branch::setLevel方法的具體用法?PHP Branch::setLevel怎麽用?PHP Branch::setLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Branch
的用法示例。
在下文中一共展示了Branch::setLevel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addBranch
/**
* Sets the current active branch in the manager
*
* @param Branch $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++;
}
示例2: addBranch
/**
* Sets the current active branch in the manager
*
* @param Branch $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->getType() == Branch::TYPE_ROOT) {
$this->setRootBranch($branch);
}
}