Destroy given event.

@param \Cortex\Bookings\Models\Event       $event
@param \Cortex\Bookings\Models\EventTicket $eventTicket

@throws \Exception

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
515490
public function destroy(Event $event, EventTicket $eventTicket)
    {
        $event->tickets()->where($eventTicket->getKeyName(), $eventTicket->getKey())->first()->delete();

        return intend([
            'url' => route('adminarea.events.tickets.index', ['event' => $event]),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/bookings::common.event_ticket'), 'identifier' => $eventTicket->name])],
        ]);
    }
524410
public function destroy($id)
    {
        $ticket = $this->tickets->findOrFail($id);
        $subject = $ticket->subject;
        $ticket->delete();

        session()->flash('status', trans('ticketit::lang.the-ticket-has-been-deleted', ['name' => $subject]));

        return redirect()->route(Setting::grab('main_route').'.index');
    }
821996
public function remove(EventInterface $event)
    {
        foreach ($this->events as $key => $internalEvent) {
            if ($event->getUid() === $internalEvent->getUid()) {
                unset($this->events[$key]);
            }
        }
    }
436326
public function delete(ResourceActionEvent $event)
    {
        $options = $event->getOptions();

        if (isset($options['hard']) && is_string($options['hard'])) {
            $hard = 'true' === $options['hard'] ? true : false;
        } else {
            if (isset($options['hard'])) {
                $hard = $options['hard'];
            } else {
                $hard = false;
            }
        }

        $this->manager->delete($event->getResourceNode(), false, !$hard);

        $event->setResponse(
            new JsonResponse(null, 204)
        );
    }
866846
public function setFlash(Event $event)
    {
        unset($event->getSubject()->params['class']);
        $event->getSubject()->element = ltrim($event->getSubject()->type);
    }
217337
protected function applyEventDeleted(EventDeleted $event)
    {
        $eventId = $event->getItemId();
        $this->repository->removeRelations($eventId);

    }
759133
public function delete(AttributeDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($attribute = AttributeQuery::create()->findPk($event->getAttributeId()))) {
            $attribute
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setAttribute($attribute);
        }
    }
20726
public function deleteUser($uid, $eventTime=null)
    {
        $eventTime = $this->getEventTime($eventTime);

        $json = json_encode([
            'event' => '$delete',
            'entityType' => 'user',
            'entityId' => $uid,
            'eventTime' => $eventTime,
        ]);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
316600
function remove()
    {

        if (!$this->subscribed()) {
            throw new Exception('No subscription');
        }

        try {

            $response = $this->_platform->delete('/restapi/v1.0/subscription/' . $this->_subscription['id']);

            $this->reset();

            $this->dispatch(self::EVENT_REMOVE_SUCCESS, new SuccessEvent($response));

            return $response;

        } catch (Exception $e) {

            $this->reset();
            $this->dispatch(self::EVENT_REMOVE_ERROR, new ErrorEvent($e));
            throw $e;

        }

    }
1085591
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof RoutableBehavior) {
            return;
        }

        $locales = $this->documentInspector->getLocales($document);
        foreach ($locales as $locale) {
            $localizedDocument = $this->documentManager->find($document->getUuid(), $locale);

            $route = $this->routeRepository->findByEntity(
                $localizedDocument->getClass(),
                $localizedDocument->getUuid(),
                $locale
            );
            if (!$route) {
                continue;
            }

            $this->entityManager->remove($route);

            if ($document instanceof ChildrenBehavior) {
                $this->removeChildRoutes($document, $locale);
            }
        }

        $this->entityManager->flush();
    }
914708
public function deleteEvents($events)
    {
        $data = array (
                'token'        => $this->apiToken,
                'content'      => 'event',
                'action'       => 'delete',
                'returnFormat' => 'json',
        );
        
        $data['events'] = $this->processEventsArgument($events, $required = true);
        
        $result = $this->connection->callWithArray($data);
        
        $this->processNonExportResult($result);
        
        return (integer) $result;
    }
1075414
public function delete(FeatureAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($feature = FeatureAvQuery::create()->findPk($event->getFeatureAvId()))) {
            $feature
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setFeatureAv($feature);
        }
    }
244456
public static function delete(String $eventName, $callback = NULL) : Bool
    {
        if( $callback === NULL )
        {
            unset(Properties::$listeners[$eventName]);
        }
        else
        {
            $callback = self::callback($callback);

            if( isset(Properties::$listeners[$eventName]) )
            {
                foreach( Properties::$listeners[$eventName][1] as $key => $callable )
                {
                    if( print_r($callback, true) === print_r($callable, true) )
                    {
                        unset(Properties::$listeners[$eventName][0][$key]);
                        unset(Properties::$listeners[$eventName][1][$key]);

                        return true;
                    }
                }
            }

            return false;
        }     

        return true;
    }
1143160
protected function fireEvent($eventName, Event $event)
    {
        if (!$this->eventDispatcher) {
            throw new \BadMethodCallException(sprintf(
                'Method %s() cannot be used while event dispatcher is not configured.',
                __METHOD__
            ));
        }

        $this->eventDispatcher->dispatch($eventName, $event);
    }
1144085
public function deleteAction(Request $request, $ticketId)
    {
        $userManager = $this->getUserManager();
        $user        = $userManager->getCurrentUser();

        if (!\is_object($user) || !$userManager->hasRole($user, TicketRole::ADMIN)) {
            throw new \Symfony\Component\HttpKernel\Exception\HttpException(403);
        }

        $form = $this->createDeleteForm($ticketId);

        if ($request->isMethod('DELETE')) {
            $form->submit($request->request->get($form->getName()));

            if ($form->isValid()) {
                $ticketManager = $this->get('hackzilla_ticket.ticket_manager');
                $ticket        = $ticketManager->getTicketById($ticketId);

                if (!$ticket) {
                    throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY', [], 'HackzillaTicketBundle'));
                }

                $ticketManager->deleteTicket($ticket);
                $this->dispatchTicketEvent(TicketEvents::TICKET_DELETE, $ticket);
            }
        }

        return $this->redirect($this->generateUrl('hackzilla_ticket'));
    }
105116
public function destroy(Request $request, Evento $evento)
	{
		$this->authorize('admin',  Auth::user());
				
		$evento->delete();
	
		return redirect(route('evento'))->with('success', 'Evento Deleted!');
	}
1345350
public function delete(EventInterface $event) {
        $event->getManager()->trigger('db.metadata.delete');
        $event->getResponse()->setModel(new Model\Metadata());
    }