protected function _ancestorIds($db, $table, $obj_id)
{
$limits = $this->_treeLimits($db, $table, $obj_id);
$sql_strs = array();
foreach ($limits as $l) {
$sql_strs[] = $this->leftAttribute . ' < ' . $l[0] . ' AND ' . $this->rightAttribute . ' > ' . $l[1];
}
$query = 'SELECT ' . $this->idAttribute . ' FROM ' . $table . ' WHERE (' . implode(') OR (', $sql_strs) . ')';
$res = $db->createCommand($query)->query();
$ids = array();
foreach ($res as $r) {
$ids[] = $r[$this->idAttribute];
}
return $ids;
}