/**
  * Delete a collection
  *
  * @apiMethod DELETE
  * @apiUri    /collections/{id}
  * @apiParameter {
  * 		"name":        "id",
  * 		"description": "Entry identifier",
  * 		"type":        "integer",
  * 		"required":    true,
  * 		"default":     null
  * }
  * @return    void
  */
 public function deleteTask()
 {
     $this->requiresAuthentication();
     $ids = Request::getVar('id', array());
     $ids = !is_array($ids) ? array($ids) : $ids;
     if (count($ids) <= 0) {
         throw new Exception(Lang::txt('COM_COLLECTIONS_ERROR_MISSING_ID'), 500);
     }
     foreach ($ids as $id) {
         $row = new Collection(intval($id));
         if (!$row->exists()) {
             throw new Exception(Lang::txt('COM_COLLECTIONS_ERROR_MISSING_RECORD'), 404);
         }
         if (!$row->delete()) {
             throw new Exception($row->getError(), 500);
         }
     }
     $this->send(null, 204);
 }