protected function recalculateTree()
	{
		if (!$this->nested_sets_enabled) {
			throw new \RuntimeException('Nested sets are disabled for this entity.');
		}

		$q_table     = $this->flupdo->quoteIdent($this->table);
		$cols        = $this->nested_sets_table_columns;
		$c_order_by  = $this->nested_sets_order_by;
		$c_id        = $this->flupdo->quoteIdent($cols['id']);
		$c_parent_id = $this->flupdo->quoteIdent($cols['parent_id']);
		$c_left      = $this->flupdo->quoteIdent($cols['left']);
		$c_right     = $this->flupdo->quoteIdent($cols['right']);
		$c_depth     = $this->flupdo->quoteIdent($cols['depth']);

		$set = $this->flupdo->select($c_id)
			->from($q_table)
			->where("$c_parent_id IS NULL")
			->orderBy($c_order_by)
			->query();

		$this->recalculateSubTree($set, 1, 0, $q_table, $c_order_by, $c_id, $c_parent_id, $c_left, $c_right, $c_depth);
	}