public function deleteAddressAction($id)
    {
        $address = $this->getAddress($id);

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

        return ['deleted' => true];
    }
public function deleteAddressAction($id)
    {
        $address = $this->getAddress($id);

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

        return ['deleted' => true];
    }
public function deleteAddressAction ( $ id ) { $ address = $ this -> getAddress ( $ id ) ; try { $ this -> addressManager -> delete ( $ address ) ; } catch ( \ Exception $ e ) { return FOSRestView :: create ( [ 'error' => $ e -> getMessage ( ) ] , 400 ) ; } return [ 'deleted' => true ] ; }
Deletes an address.

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

@param int $id An Address identifier

@throws NotFoundHttpException

@return \FOS\RestBundle\View\View
Deletes an address .