public function deleteAction($eventId)
{
$this->checkPermissions(Acl::RESOURCE_GENERAL_CUSTOM_EVENTS, Acl::PERM_GENERAL_CUSTOM_EVENTS_MANAGE);
$event = $this->getEvent($eventId, true);
if ($event->getUsed()) {
throw new ApiErrorException(409, ErrorMessage::ERR_OBJECT_IN_USE, sprintf('Event with ID %s is in use.', $eventId));
}
$event->delete();
return $this->result(null);
}