src/Controller/Framework/DocTreeController.php
/**
     * Deletes a LsDefAssociationGrouping entity, ajax/treeview version.
     *
     * @Route("/assocgroup/{id}/delete", methods={"POST"}, name="lsdef_association_grouping_tree_delete")
     *
     * @throws \InvalidArgumentException
     */
Deletes a LsDefAssociationGrouping entity, ajax/treeview version.


Deletes a LsDefAssociationGrouping entity ajax / treeview version .
public function deleteAssocGroupAction(Request $request, LsDefAssociationGrouping $associationGrouping): Response
    {
        $command = new DeleteAssociationGroupCommand($associationGrouping);
        try {
            $this->sendCommand($command);
        } catch (\Exception $e) {
            if (preg_match('/FOREIGN KEY/', $e->getMessage())) {
                return new JsonResponse(['error' => ['message' => 'An association group may only be deleted if there are no associations in it.']], Response::HTTP_BAD_REQUEST);
            }
            return new JsonResponse(['error' => ['message' => 'The association group could not be deleted.']], Response::HTTP_BAD_REQUEST);
        }
        return new JsonResponse('OK', Response::HTTP_ACCEPTED);
    }
public function deleteAssocGroupAction ( Request $ request , LsDefAssociationGrouping $ associationGrouping ) : Response { $ command = new DeleteAssociationGroupCommand ( $ associationGrouping ) ; try { $ this -> sendCommand ( $ command ) ; } catch ( \ Exception $ e ) { if ( preg_match ( '/FOREIGN KEY/' , $ e -> getMessage ( ) ) ) { return new JsonResponse ( [ 'error' => [ 'message' => 'An association group may only be deleted if there are no associations in it.' ] ] , Response :: HTTP_BAD_REQUEST ) ; } return new JsonResponse ( [ 'error' => [ 'message' => 'The association group could not be deleted.' ] ] , Response :: HTTP_BAD_REQUEST ) ; } return new JsonResponse ( 'OK' , Response :: HTTP_ACCEPTED ) ; }
Deletes a LsDefAssociationGrouping entity, ajax/treeview version.
Deletes a LsDefAssociationGrouping entity ajax / treeview version .