Deletes a cart item
@param int $cart_id
@return array
492299
public function delete($cart_id)
    {
        $result = array();
        $this->hook->attach('cart.delete.item.before', $cart_id, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        $cart = $this->cart->get($cart_id);

        if (empty($cart) || !$this->cart->delete($cart_id)) {
            return $this->getResultError();
        }

        $result = $this->getResultDelete($cart);
        $this->hook->attach('cart.delete.item.after', $cart_id, $result, $this);
        return $result;
    }
1240510
public function deleteCartItem($cid) {
    $account = \Drupal::currentUser();
    $query = $this->connection->delete('site_cart');
    $query->condition('cid', $cid);
    $query->execute();
    return $query;
  }
949294
protected static function deleteProductByIdAsyncWithHttpInfo($product_id) 
    {
        $returnType = '';  
        $request = self::deleteProductByIdRequest($product_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
257013
public function remove($rowId)
    {
        $cartItem = $this->get($rowId);

        $content = $this->getContent();

        $content->pull($cartItem->rowId);

        $this->events->fire('cart.removed', $cartItem);

        $this->session->put($this->instance, $content);
    }
984658
public function destroy(CartItem $cartitem)
    {
        $this->cart->remove($cartitem->id);

        return response()->json([
            'errors' => false,
            'data' => $this->cart->items()
        ]);
    }
1136978
public static function delete($topic_id)
    {
        // Delete the topic and any redirect topics
        $where_delete_topic = [
            ['id' => $topic_id],
            ['moved_to' => $topic_id]
        ];

        DB::forTable('topics')
            ->where_any_is($where_delete_topic)
            ->delete_many();

        // Delete posts in topic
        DB::forTable('posts')
            ->where('topic_id', $topic_id)
            ->delete_many();

        // Delete any subscriptions for this topic
        DB::forTable('topic_subscriptions')
            ->where('topic_id', $topic_id)
            ->delete_many();
    }
1015872
public function addCartItem($cartId, $cartItem)
    {
        $cartItem['id'] = count(session($this->itemsKey)) + 1;

        session()->push($this->itemsKey, $cartItem);
    }
52236
public function canDelete($collection_id)
    {
        $sql = 'SELECT collection_item_id FROM collection_item WHERE collection_id=?';
        $result = $this->db->fetchColumn($sql, array($collection_id));
        return empty($result);
    }
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']);
    }
26021
public function deleteCustomer($customer_id)
    {
        $response = $this->client->delete('customers/' . $customer_id);
        return json_decode($response->getBody())->customer;
    }
1306034
private function findCartBySessionId()
    {
        $sessionId = $this->session->getId();
        $cartsArray = $this->orderRepository->findBy(
            array(
                'sessionId' => $sessionId,
                'status' => OrderStatus::STATUS_IN_CART
            ),
            array(
                'created' => 'DESC'
            )
        );

        return $cartsArray;
    }
1368318
public function canDelete($file_id)
    {
        $sql = 'SELECT NOT EXISTS (SELECT file_id FROM product_sku WHERE file_id=:id)';
        return (bool) $this->db->fetchColumn($sql, array('id' => (int) $file_id));
    }
465488
public function updateCart($cartId, $cartData)
    {
        $items = session($this->itemsKey);

        session([
            $this->sessionKey => array_merge($cartData, ['items' => $items]),
        ]);
    }
711625
public function removeCartItem($cartItemId)
    {
        $items = collect(session($this->itemsKey));

        $items = $items->reject(function ($item) use ($cartItemId) {
            return $item['id'] == $cartItemId;
        });

        session([$this->itemsKey => $items]);
    }
1247275
public function clearData()
    {
        $cart = Cart::where($this->cartIdentifier())->first();

        if ($cart) {
            $cart->delete();
        }
    }
1169712
public function delete(int $id)
    {
        try {
            $sh = @shmop_open($this->getSharedItemKey($id), 'w', 0, 0);
        } catch (\Throwable $e) {
            return false;
        }

        if (!$sh) {
            return false;
        }

        $deleted = shmop_delete($sh);
        shmop_close($sh);

        return $deleted;
    }
1081533
public function delete($id)
    {
        // Find the given instance
        $deleted  = false;
        $instance = $id instanceof Model ? $id : $this->find($id);

        if ($instance) {
            // Delete the instance
            $deleted = $instance->delete();

            // Fire the deleted event
            $this->getContainer('events')->fire($this->getRepositoryId().'.entity.deleted', [$this, $instance]);
        }

        return [
            $deleted,
            $instance,
        ];
    }