Deletes a submitted cart item
@param \gplcart\core\models\CartAction $cart_action_model
325645
public function deleteFromCart($cart_action_model)
    {
        $result = $cart_action_model->delete($this->getSubmitted('cart_id'));

        if (empty($result['quantity'])) {
            $result['message'] = '';
        }

        if ($this->isAjax()) {
            $result['modal'] = $this->getCartPreview();
            $this->outputJson($result);
        }

        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
334211
public function removeAction($id)
    {
        $em = $this->getDoctrine()->getManager();
        $cart = $this->getCurrentCart();
        $repository = $em->getRepository('EcommerceBundle:CartItem');
        $item = $repository->find($id);

        if (!$item || false === $cart->hasItem($item)) {
            // Write flash message
            return $this->redirect($this->generateUrl('ecommerce_checkout_detail'));
        }

        // Update models
        $cart->removeItem($item);
        $cart->setTotalItems(count($cart->getItems()));
        $em->flush();
        // Write flash message

        return $this->redirect($this->generateUrl('ecommerce_checkout_detail'));
    }
1182532
public function emptyCart()
    {
        unset($this->cart->items);

        $this->update();

        $this->events->dispatch('laracart.empty', $this->cart->instance);
    }
1262348
protected function deleteOrder()
    {
        $this->controlAccess('order_delete');

        if ($this->order->delete($this->data_order['order_id'])) {
            $this->redirect('admin/sale/order', $this->text('Order has been deleted'), 'success');
        }

        $this->redirect('', $this->text('Order has not been deleted'), 'warning');
    }
286411
public function removeActionType(\BlackForest\PiwikBundle\Entity\PiwikActionType $actionType)
    {
        return $this->actionType->removeElement($actionType);
    }
599099
public function remove()
    {
        $key = $this->request->param('ID');
        $item = null;
        $title = null;

        if (isset($key)) {
            $item = $this
                ->Items()
                ->find("Key", $key);
        }

        if (isset($item)) {
            $title = $item->Title;
            ShoppingCartFactory::create()->removeItem($item);

            $form = $this->CartForm();
            $form->sessionMessage(_t(
                "ShoppingCart.RemovedItem",
                "Removed '{title}' from your cart",
                ["title" => $title]
            ));
        }

        return $this->redirectBack();
    }
500959
public function deleteFromProductCompare($compare_action_model)
    {
        $product_id = $this->getSubmitted('product_id');
        $result = $compare_action_model->delete($product_id);

        if ($this->isAjax()) {
            $this->outputJson($result);
        }

        $this->controlDeleteProductCompare($result, $product_id);
        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
218965
public function removeAction(\BlackForest\PiwikBundle\Entity\PiwikAction $action)
    {
        return $this->action->removeElement($action);
    }
1052584
public function removeItems(Transaction $transaction)
    {
        $qb = $this->getItemQueryBuilder()
            ->delete()
            ->where('i.transaction = :transaction')
            ->setParameter('transaction', $transaction);

        $qb->getQuery()->execute();
    }
1266095
public function addToCart($cart_action_model)
    {
        $errors = $this->error();

        if (empty($errors)) {
            $submitted = $this->getSubmitted();
            $result = $cart_action_model->add($submitted['product'], $submitted);
        } else {

            $result = array(
                'redirect' => '',
                'severity' => 'warning',
                'message' => $this->format($errors)
            );
        }

        if ($this->isAjax()) {
            $result['modal'] = $this->getCartPreview();
            $this->outputJson($result);
        }

        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
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)
        );
    }
19115
public function deleteAction()
    {
        $attribute = (new \Cms\Orm\CmsAttributeQuery)->findPk($this->id);
        if ($attribute && $attribute->delete()) {
            $this->getMessenger()->addMessage('messenger.attribute.deleted', true);
        }
        $this->getResponse()->redirect('cmsAdmin', 'attribute', 'index');
    }
224226
public function deleteAction(Asset $asset): void
    {
        $usageReferences = $this->assetService->getUsageReferences($asset);
        if (count($usageReferences) > 0) {
            $this->addFlashMessage('deleteRelatedNodes', '', Message::SEVERITY_WARNING, [], 1412422767);
            $this->redirect('index');
        }

        $this->assetRepository->remove($asset);
        $this->addFlashMessage('assetHasBeenDeleted', '', Message::SEVERITY_OK, [$asset->getLabel()], 1412375050);
        $this->redirect('index');
    }
334669
public function deleteAction()
    {
        $record = (new \Cms\Orm\CmsCategoryTypeQuery)->findPk($this->id);
        if ($record && $record->delete()) {
            $this->getMessenger()->addMessage('messenger.categoryTypeAttribute.categoryType.deleted', true);
        }
        $this->getResponse()->redirect('cmsAdmin', 'categoryType');
    }
1120382
def del_action_role(ctx):
    """"""

    objects = ctx.obj['objects']
    action = ctx.obj['action']
    role = ctx.obj['role']

    if action is None or role is None:
        log('You need to specify an action or role to the RBAC command group for this to work.', lvl=warn)
        return

    for item in objects:
        if role in item.perms[action]:
            item.perms[action].remove(role)
            item.save()

    log("Done")
1025206
public function actionDeleteAll()
    {
        if (isset($_POST['items'])) {
            foreach ($_POST['items'] as $id) {
                $this->findModel($id)->delete();
            }
        }
    }
694061
public function deleteAction()
    {
        if ($this->isConfirmedItem($this->_('Delete %s'))) {
            $model   = $this->getModel();
            $deleted = $model->delete();

            $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');
            $this->_reroute(array('action' => 'index'), true);
        }
    }