Triggers the delete event with provided action

@param EntityInterface $entity
@param string $action
@return \League\Event\EventInterface|Delete
172363
protected function triggerDelete(
        EntityInterface $entity, $action = Delete::ACTION_BEFORE_DELETE
    ) {
        $event = new Delete($entity);
        $event->setAction($action);
        return Orm::getEmitter($this->getEntityClassName())
            ->emit($event);
    }
1031482
public function afterDelete(Event $event, Entity $entity) {
        // configuration set?
        $this->check();

        // delete existing files linked to this entity
        foreach($this->_config['fields'] as $field => $path)
            $this->deleteFile($entity->get($field));
    }
1331420
public function deleteAction($id)
    {
        try {
            $delete = function($id) {
                /* @var ContactTitle $title */
                $title = $this->getDoctrine()
                    ->getRepository(self::$entityName)
                    ->find($id);

                if (!$title) {
                    throw new EntityNotFoundException(self::$entityName, $id);
                }

                $em = $this->getDoctrine()->getManager();
                $em->remove($title);
                $em->flush();
            };

            $view = $this->responseDelete($id, $delete);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        }

        return $this->handleView($view);
    }
796917
public function createDeleteForm($entity, $entityClass)
    {
        return $this->createIdForm($entity, 'delete_', $this->adminRouter->generate($entity, $entityClass, AdminRouter::TYPE_DELETE));
    }
1324723
public function beforeDelete(Delete $event)
    {
        $parent = $event->getEntity()->{$this->propertyName};
        if ($parent instanceof EntityInterface) {
            $parent->delete();
        }
    }
523823
public function delete($uri, $action)
    {
        $uri = $this->buildUri($uri);

        return $this->addResponseType(Route::delete($uri, $action));
    }
590379
public function afterSave(Event $event, EntityInterface $entity)
    {
        $property = $this->versionAssociation()->getProperty();
        $entity->unsetProperty($property);
    }
13729
public function deleteAction(Module $entity)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('module', 'DELETE')) {
            throw $this->createAccessDeniedException();
        }

        $handler = new ModuleFormHandler(
            $this->createDeleteForm('module_delete', $entity),
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );

        $handler->delete($entity);

        return $this->redirect($this->generateUrl('module'));
    }
1136751
public function delete(EntityInterface $entity)
    {
        return $this->infakt->delete($this->getServiceName().'/'.$entity->getId().'.json');
    }
1240062
public function deleteAction($id)
    {
        $acl = $this->get('bacon_acl.service.authorization');

        if (!$acl->authorize('module-actions', 'DELETE')) {
            throw $this->createAccessDeniedException();
        }

        $formHandlerName    =   $this->getParameter('bacon_acl.forms.module_actions_form_handler_class');

        $entity = $this->getRepository()->find($id);

        if (!$entity) {
            return $this->createNotFoundException('Entity not Exists!');
        }

        $handler = new $formHandlerName(
            $this->createDeleteForm('module_actions_delete', $entity),
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );

        $handler->delete($entity);

        return $this->redirect($this->generateUrl('module_actions'));
    }
174121
public function deleteAction()
    {
        $entity = $this->loadEntity();
        //TODO: change method to post maybe
        $objectManager = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager');
        $objectManager->remove($entity);
        $objectManager->flush();

        $controller = explode('/', $this->getRequest()->getUri()->getPath())[2];

        if (!$this->getRequest()->isXmlHttpRequest()) {
            return $this->redirect()->toRoute(null, ['controller' => $controller]);
        }
        return;
    }
743980
public function remove($action, $id = null)
    {
        /** @var $query \eZ\Publish\Core\Persistence\Database\DeleteQuery */
        $query = $this->dbHandler->createDeleteQuery();
        $query->deleteFrom(
            $this->dbHandler->quoteTable($this->table)
        )->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('action'),
                $query->bindValue($action, null, \PDO::PARAM_STR)
            )
        );

        if ($id !== null) {
            $query->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('is_alias'),
                        $query->bindValue(0, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('id'),
                        $query->bindValue($id, null, \PDO::PARAM_INT)
                    )
                )
            );
        }

        $query->prepare()->execute();
    }
266500
public function delete($entity) {
		if (is_null($entity))
			return;
		
		//connect to database
		$this->mapper->connect();
		
		//begin transaction
		$this->mapper->beginTransaction();
		
		//get primary key
		$pk = $this->getPropertyValue($this->entityProfile, $entity, $this->entityProfile->getPrimaryKey());

		foreach ($this->entityProfile->getReferences() as $assoc)
			$this->entityProfile->getAssociation($assoc)->delete($this->mapper, $pk);
		
		//build fluent query
		$query = $this->mapper->newQuery()
		->deleteFrom($this->entityProfile->getEntityTable())
		->where(Column::__callstatic($this->entityProfile->getPrimaryKey(true))->eq($pk));
		
		//run query
		$result = $query->exec();
		
		//commit
		$this->mapper->commit();
		return $result;
	}
758393
@SuppressWarnings("unchecked")
    public <T extends IEntity> T delete(T entity) throws FMSException {

        IntuitMessage intuitMessage = prepareDelete(entity);

        //execute interceptors
        executeInterceptors(intuitMessage);

        return (T) retrieveEntity(intuitMessage);
    }
977572
public function delete()
    {
        if (!$this->hasId()) {
            throw new DeleteException('ID not set - did you call find($id) before delete()?');
        }

        if (!$this->isDeletable()) {
            throw new DeleteException('Permission denied: Entity can not be deleted');
        }

        $this->transactional(function () {
            $this->forceDelete();
        });

        return $this;
    }
841239
public function deleteAction($id)
    {
        try {
            $this->getManager()->delete($id);
            $view = $this->view($id, 204);
        } catch (FilterNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        }

        return $this->handleView($view);
    }
938818
public function delete($entity)
    {
        $event = new StorageEvent($entity);
        $this->event()->dispatch(StorageEvents::PRE_DELETE, $event);
        $qb = $this->em->createQueryBuilder()
            ->delete($this->getTableName())
            ->where('id = :id')
            ->setParameter('id', $entity->getId());

        $response = $qb->execute();
        $event = new StorageEvent($entity);
        $this->event()->dispatch(StorageEvents::POST_DELETE, $event);

        return $response;
    }