TreeBehavior::_descendentIds PHP Méthode

_descendentIds() protected méthode

* gets the list of left and right boundaries for any given owner objects
protected _descendentIds ( $db, $tree_table, $obj_id )
$db
$tree_table
$obj_id
    protected function _descendentIds($db, $tree_table, $obj_id)
    {
        $limits = $this->_treeLimits($db, $tree_table, $obj_id);
        $ids = array();
        if (count($limits)) {
            $sql_strs = array();
            foreach ($limits as $l) {
                $sql_strs[] = $this->leftAttribute . ' > ' . $l[0] . ' AND ' . $this->rightAttribute . ' <  ' . $l[1];
            }
            $query = 'SELECT ' . $this->idAttribute . ' FROM ' . $tree_table . ' WHERE (' . implode(') OR (', $sql_strs) . ') ORDER BY lft';
            $res = $db->createCommand($query)->query();
            foreach ($res as $r) {
                $ids[] = $r[$this->idAttribute];
            }
        }
        return $ids;
    }