public function deleteBasketAction($id)
    {
        $basket = $this->getBasket($id);

        try {
            $this->basketManager->delete($basket);
        } catch (\Exception $e) {
            return FOSRestView::create(['error' => $e->getMessage()], 400);
        }

        return ['deleted' => true];
    }
public function deleteBasketAction($id)
    {
        $basket = $this->getBasket($id);

        try {
            $this->basketManager->delete($basket);
        } catch (\Exception $e) {
            return FOSRestView::create(['error' => $e->getMessage()], 400);
        }

        return ['deleted' => true];
    }
public function deleteBasketAction ( $ id ) { $ basket = $ this -> getBasket ( $ id ) ; try { $ this -> basketManager -> delete ( $ basket ) ; } catch ( \ Exception $ e ) { return FOSRestView :: create ( [ 'error' => $ e -> getMessage ( ) ] , 400 ) ; } return [ 'deleted' => true ] ; }
Deletes a basket.

@ApiDoc(
requirements={
{"name"="id", "dataType"="integer", "requirement"="\d+", "description"="basket identifier"}
},
statusCodes={
200="Returned when basket is successfully deleted",
400="Returned when an error has occurred while basket deletion",
404="Returned when unable to find basket"
}
)

@param int $id A Basket identifier

@throws NotFoundHttpException

@return \FOS\RestBundle\View\View
Deletes a basket .