Scalr\Api\Service\User\V1beta0\Controller\Events::deleteAction PHP Метод

deleteAction() публичный Метод

Deletes the event from the curent scope
public deleteAction ( string $eventId ) : Scalr\Api\DataType\ResultEnvelope
$eventId string Unique identifier of the Event
Результат Scalr\Api\DataType\ResultEnvelope
    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);
    }