Deletes a submitted product from comparison
@param \gplcart\core\models\ProductCompareAction $compare_action_model
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']);
    }
214824
public function delete()
	{
		parent::delete();

		$manager = \Aimeos\MShop::create( $this->getContext(), 'stock' );

		$code = $this->getView()->item->getCode();
		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'stock.productcode', $code ) );

		$manager->deleteItems( array_keys( $manager->searchItems( $search ) ) );
	}
772411
public function removeArtFromAct()
    {
        $aChosenArt = $this->_getActionIds('oxactions2article.oxid');
        $sOxid = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxid');

        $this->_getOxRssFeed()->removeCacheFile($sOxid);

        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sQ = parent::_addFilter("delete oxactions2article.* " . $this->_getQuery());
            \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
        } elseif (is_array($aChosenArt)) {
            $sChosenArticles = implode(", ", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aChosenArt));
            $sQ = "delete from oxactions2article where oxactions2article.oxid in (" . $sChosenArticles . ") ";
            \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->Execute($sQ);
        }
    }
1199631
public function deleteAction(Request $request, Brand $brand)
    {
        $form = $this->createDeleteForm($brand);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            
            $em = $this->getDoctrine()->getManager();
            $em->remove($brand);
            $em->flush();
            
            $this->get('session')->getFlashBag()->add('info', 'brand.deleted');
        }

        return $this->redirectToRoute('ecommerce_brand_index');
    }
1254928
public function deleteAction()
    {
        try {
            $stack = $this->_initStackInstance();
            if ($stack) {
                $stack->delete();
                $this->_getSession()->addSuccess( $this->__( 'The entry has been deleted.' ) );
            }
        } catch (Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }

        $this->_redirect('*/*/');
    }
1159515
public function deleteProduct( $position )
	{
		$product = $this->_basket->getProduct( $position );

		if( $product->getFlags() === MShop_Order_Item_Base_Product_Abstract::FLAG_IMMUTABLE )
		{
			$msg = sprintf( 'Basket item at position "%1$d" cannot be deleted manually', $position );
			throw new Controller_Frontend_Basket_Exception( $msg );
		}

		$this->_basket->deleteProduct( $position );
		$this->_domainManager->setSession( $this->_basket );
	}
688629
public function delete($product_id)
    {
        $result = null;
        $this->hook->attach('product.related.delete.before', $product_id, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        foreach (array('product_id', 'item_product_id') as $field) {
            if (!$this->db->delete('product_related', array($field => $product_id))) {
                return false;
            }
        }

        $this->hook->attach('product.related.delete.after', $product_id, $result, $this);
        return (bool) $result;
    }
1198851
public function delete(ProductSaleElementDeleteEvent $event)
    {
        if (null !== $pse = ProductSaleElementsQuery::create()->findPk($event->getProductSaleElementId())) {
            $product = $pse->getProduct();

            $con = Propel::getWriteConnection(ProductSaleElementsTableMap::DATABASE_NAME);

            $con->beginTransaction();

            try {
                // If we are deleting the last PSE of the product, don(t delete it, but insteaf
                // transform it into a PSE detached for any attribute combination, so that product
                // prices, weight, stock and attributes will not be lost.
                if ($product->countSaleElements($con) === 1) {
                    $pse
                        ->setIsDefault(true)
                        ->save($con);
                    // Delete the related attribute combination.
                    AttributeCombinationQuery::create()
                        ->filterByProductSaleElementsId($pse->getId())
                        ->delete($con);
                } else {
                    // Delete the PSE
                    $pse->delete($con);
                    // If we deleted the default PSE, make the last created one the default
                    if ($pse->getIsDefault()) {
                        $newDefaultPse = ProductSaleElementsQuery::create()
                            ->filterByProductId($product->getId())
                            ->filterById($pse->getId(), Criteria::NOT_EQUAL)
                            ->orderByCreatedAt(Criteria::DESC)
                            ->findOne($con)
                        ;
                        if (null !== $newDefaultPse) {
                            $newDefaultPse->setIsDefault(true)->save($con);
                        }
                    }
                }

                // Store all the stuff !
                $con->commit();
            } catch (\Exception $ex) {
                $con->rollback();

                throw $ex;
            }
        }
    }
532569
public function delete()
    {
        if ($this->batchId !== null) {
            $this->sendApiCall(self::ACTION_REMOVE, $this->getCreateUrl() . '/' . urlencode($this->batchId));
        }
    }
20165
public function deleteAction()
	{
		$page = $this->getPageLocalization()
				->getMaster();

		$entityManager = $this->getEntityManager();

		$count = (int) $entityManager->createQuery(sprintf('SELECT COUNT(p.id) FROM %s p WHERE p.template = ?0', PageLocalization::CN()))
				->setParameters(array($page->getId()))
				->getSingleScalarResult();

		if ($count > 0) {
			throw new CmsException(null, "Cannot remove template, {$count} page(s) still uses it.");
		}

		$entityManager->remove($page);
		$entityManager->flush();

		return new SupraJsonResponse();
	}
79206
public function deleteFromWishlist($wishlist_action_model)
    {
        $product = array(
            'user_id' => $this->getCartUid(),
            'store_id' => $this->getStoreId(),
            'product_id' => $this->getSubmitted('product_id')
        );

        $result = $wishlist_action_model->delete($product);

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

        $this->redirect($result['redirect'], $result['message'], $result['severity']);
    }
69185
public function deleteAction(MeasureUnit $measureunit, Request $request)
    {
        $form = $this->createDeleteForm($measureunit->getId(), 'admin_shop_measure_unit_delete');
        if ($form->handleRequest($request)->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($measureunit);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('admin_shop_measure_unit'));
    }
717994
def admin_remove_from_category
      return if !user_is_allowed('products', 'edit')
      cat_id = params[:category_id]
      product_id = params[:id]
      
      if CategoryMembership.exists?(:category_id => cat_id, :product_id => product_id)
        CategoryMembership.where(:category_id => cat_id, :product_id => product_id).destroy_all
      end        
      render :json => true
    end
353299
public function deleteAction(Request $request, PaymentServiceProvider $paymentServiceProvider)
    {
        $form = $this->createDeleteForm($paymentServiceProvider);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($paymentServiceProvider);
            $em->flush();
        }

        return $this->redirectToRoute('ecommerce_paymentserviceprovider_index');
    }
795267
function removeThis( $remove_childs = false )
    {
        $db = eZDB::instance();
        $db->begin();
        if ( is_array( $remove_childs ) )
        {
            foreach( $remove_childs as $event )
            {
                $event->remove();
            }
        }
        else if ( $remove_childs )
        {
            eZPersistentObject::removeObject( eZWorkflowEvent::definition(),
                                              array( "workflow_id" => $this->ID,
                                                     "version" => $this->Version ) );
        }

        $this->remove();
        $db->commit();
    }
1262180
private function action_delete()
    {
        $mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true)); //UTF7-IMAP
        $user = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_POST));

        $user = explode(',', $user);

        foreach ($user as $u) {
            $u = trim($u);
            if ($this->rc->storage->delete_acl($mbox, $u)) {
                $this->rc->output->command('acl_remove_row', rcube_utils::html_identifier($u));
            }
            else {
                $error = true;
            }
        }

        if (!$error) {
            $this->rc->output->show_message('acl.deletesuccess', 'confirmation');
        }
        else {
            $this->rc->output->show_message('acl.deleteerror', 'error');
        }
    }
995845
public function delete($product_id, $check = true)
    {
        $result = null;
        $this->hook->attach('product.delete.before', $product_id, $check, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if ($check && !$this->canDelete($product_id)) {
            return false;
        }

        $result = (bool) $this->db->delete('product', array('product_id' => $product_id));

        if ($result) {
            $this->deleteLinked($product_id);
        }

        $this->hook->attach('product.delete.after', $product_id, $check, $result, $this);
        return (bool) $result;
    }