public function delete($id)
    {
        if ($ids = $this->db->ids(array(
            'SELECT node.id',
            'FROM '.$this->table.' AS node, '.$this->table.' AS parent',
            'WHERE node.lft BETWEEN parent.lft AND parent.rgt AND parent.'.$this->id.' = ?',
            'ORDER BY node.lft',
        ), $id)) {
            $this->db->exec('DELETE FROM '.$this->table.' WHERE '.$this->id.' IN('.implode(', ', $ids).')');

            return $ids;
        }

        return false;
    }