TreeBehavior::treeStart PHP Method

treeStart() public method

works out the starting point for a new tree.
public treeStart ( )
    public function treeStart()
    {
        $owner = $this->getOwner();
        $db = $owner->getDbConnection();
        $query = 'SELECT MAX(' . $this->rightAttribute . ') AS maxright FROM ' . $owner->treeTable();
        $val = $db->createCommand($query)->queryRow();
        if ($val['maxright']) {
            return $val['maxright'] + 1;
        } else {
            return 1;
        }
    }