WellCommerce\Bundle\CoreBundle\Controller\Admin\AbstractAdminController::deleteAction PHP Method

deleteAction() public method

public deleteAction ( integer $id ) : Response
$id integer
return Symfony\Component\HttpFoundation\Response
    public function deleteAction(int $id) : Response
    {
        $this->getDoctrineHelper()->disableFilter('locale');
        try {
            $resource = $this->getManager()->getRepository()->findOneBy(['id' => $id]);
            $this->getManager()->removeResource($resource);
        } catch (\Exception $e) {
            return $this->jsonResponse(['error' => $e->getTraceAsString()]);
        }
        return $this->jsonResponse(['success' => true]);
    }