Removes item from cart.
It takes an item id as an argument.

If the item is found and the current user cart contains that item,
it will be removed and the cart - refreshed and saved.

@param mixed $id
@return Response

@Route("/cart/remove/{id}")
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'));
    }
442467
function delete($id)
    {
        $this->requestDecorator->setId($id);
        $result = $this->client->delete($this->requestDecorator->makeResource(), $this->requestDecorator->makeHeaders());
        $this->refresh();
        return $result;
    }
983731
public function deleteRow($id)
    {
        unset($this->rows[$id]);

        if (in_array($id, $this->specialRows['header'])) {
            unset($this->specialRows['header'][array_search($id, $this->specialRows['header'])]);
        }

        if (in_array($id, $this->specialRows['footer'])) {
            unset($this->specialRows['footer'][array_search($id, $this->specialRows['footer'])]);
        }

        if ($this->activeRow == $id) {
            end($this->rows);
            $this->activeRow = key($this->rows);
        }

        return $this;
    }
921106
public function destroy($id)
    {
        // Find the item
        $item = $this->findOrFail($id);

        // Delete row (this should trigger file attachment deletes as well)
        $item->delete();

        // As long as not an ajax request, go back to the parent directory of the referrer
        if (Request::ajax()) {
            return Response::json();
        } else {
            return Redirect::to(DecoyURL::relative('index'))
            ->with('success', $this->successMessage($item, 'deleted'));
        }
    }
1246851
public function itemGet($id) {
		$list = $this->itemsGet(array($id));
		$item = reset($list);
		return $item;
	}
1222968
public function deleteAction($id)
    {
        $response = parent::deleteAction($id);
        $this->fileManager->remove($id);
        return $response;
    }
255414
public
    function destory($id)
    {
        $row = Model::find($id);
        $row->delete();
        flash()->success('Your Item Deleted');
        return redirect()->to(self::getScope().'/'.self::getModule($this));
    }
730947
public function remove(string $id)
    {
        $url = self::$base_url.'/'.$id;

        return self::$curl->delete($url);
    }
1042427
static function removeByID( $id )
    {
        $policy = eZPolicy::fetch( $id );
        if ( !$policy )
        {
            return null;
        }
        $policy->removeThis();
    }
275245
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Configs::authManager()->remove($model->item);
        Helper::invalidate();

        return $this->redirect(['index']);
    }
21854
public function destroy($id)
    {
        $this->entriesRepository->delete($id, $this->resource);

        return response()->json(['status' => 'ok']);
    }
538189
public function destroy($id)
    {
        try {
            $this->content->destroy($id);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.delete', ['object' => trans('soda::terminology.content')]));
        }

        return redirect()->back()->with('info', trans('soda::messages.deleted', ['object' => trans('soda::terminology.content')]));
    }
1030052
public function actionRemove(int $id)
    {

        RelatedProduct::deleteAll(['id' => $id]);

        return $this->redirect(\Yii::$app->request->referrer);
    }
591118
public function destroy($id)
    {
        $this->model->findOrFail($id)->delete();

        $this->notify([
            'type' => 'danger',
            'title' => 'Successful deleted Role!',
            'description' => 'The role is deleted successfully.',
        ]);

        return redirect()->back();
    }
775254
public function remove($uniqueId)
    {
        if ($cartItem = $this->get($uniqueId)) {
            $this->content->pull($cartItem->getUniqueId());

            return true;
        }

        return false;
    }
101956
public function actionRemove($id)
    {
        $items = Yii::$app->getRequest()->post('items', []);
        $model = $this->findModel($id);
        $success = $model->removeChildren($items);
        Yii::$app->getResponse()->format = 'json';

        return array_merge($model->getItems(), ['success' => $success]);
    }
1180431
public function destroy($id)
    {
        $request = $this->makeRequest('destroy');
        $deleted = $this->service->destroy($id);
        return $this->maybeMakeResource('delete', $deleted);

    }