Passed
Push — master ( 63b7b4...90b76b )
by Andrea
18:06
created

OpzioniTabellaController::deleteAction()   B

Complexity

Conditions 3
Paths 9

Size

Total Lines 32
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 3.054

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 18
cts 22
cp 0.8182
rs 8.8571
c 0
b 0
f 0
cc 3
eloc 22
nc 9
nop 1
crap 3.054
1
<?php
2
3
/* Qui Bundle */
4
//namespace Fi\DemoBundle\Controller;
5
6
namespace Fi\CoreBundle\Controller;
7
8
use Symfony\Component\HttpFoundation\Request;
9
use Symfony\Component\HttpFoundation\Response;
10
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
11
12
/**
13
 * OpzioniTabella controller.
14
 */
15
class OpzioniTabellaController extends FiCoreController
16
{
17
18
    /**
19
     * Lists all opzioniTabella entities.
20
     */
21 1
    public function indexAction(Request $request)
22
    {
23
        /* @var $em \Doctrine\ORM\EntityManager */
24 1
        $this->setup($request);
25 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
26 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
27 1
        $controller = $this->getController();
28 1
        $container = $this->container;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
29
30 1
        $nomebundle = $namespace . $bundle . 'Bundle';
31
32
        $dettaglij = array(
33
            'descrizione' => array(
34
                array(
35 1
                    'nomecampo' => 'descrizione',
36 1
                    'lunghezza' => '400',
37 1
                    'descrizione' => 'Descrizione',
38 1
                    'tipo' => 'text',),),
39
            'parametro' => array(
40
                array(
41 1
                    'nomecampo' => 'parametro',
42 1
                    'lunghezza' => '300',
43 1
                    'descrizione' => 'Parametro',
44 1
                    'tipo' => 'text',),),
45
            'valore' => array(
46
                array(
47 1
                    'nomecampo' => 'valore',
48 1
                    'lunghezza' => '300',
49 1
                    'descrizione' => 'Valore',
50 1
                    'tipo' => 'text',),),
51
            'tabelle_id' => array(
52
                array(
53 1
                    'nomecampo' => 'tabelle.nometabella',
54 1
                    'lunghezza' => '400',
55 1
                    'descrizione' => 'Tabella',
56 1
                    'tipo' => 'text',),
57 1
            ),
58 1
        );
59
60 1
        $escludi = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
61
        $paricevuti = array(
62 1
            'nomebundle' => $nomebundle,
63 1
            'nometabella' => $controller,
64 1
            'dettaglij' => $dettaglij,
65 1
            'escludere' => $escludi,
66 1
            'container' => $container,
67 1
        );
68
69 1
        $testatagriglia = Griglia::testataPerGriglia($paricevuti);
70
71 1
        $testatagriglia['multisearch'] = 1;
72 1
        $testatagriglia['showconfig'] = 1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
73 1
        $testatagriglia['showadd'] = 1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
74 1
        $testatagriglia['showedit'] = 1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
75 1
        $testatagriglia['showdel'] = 1;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
76 1
        $testatagriglia['editinline'] = 0;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
77
78 1
        $testatagriglia['parametritesta'] = json_encode($paricevuti);
79 1
        $this->setParametriGriglia(array('request' => $request));
80 1
        $testatagriglia['parametrigriglia'] = json_encode(self::$parametrigriglia);
81
82 1
        $testata = json_encode($testatagriglia);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
83
        $twigparms = array(
84 1
            'nomecontroller' => $controller,
85 1
            'testata' => $testata,
86 1
        );
87
88 1
        return $this->render($nomebundle . ':' . $controller . ':index.html.twig', $twigparms);
89
    }
90
91 1
    public function setParametriGriglia($prepar = array())
92
    {
93 1
        $this->setup($prepar['request']);
94 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
95 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
96 1
        $controller = $this->getController();
97
98 1
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
99 1
        $escludi = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 16 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
100 1
        $tabellej = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 15 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
101 1
        $tabellej['tabelle_id'] = array('tabella' => 'tabelle', 'campi' => array('nometabella'));
102
103
        $paricevuti = array(
104 1
            'container' => $this->container,
105 1
            'nomebundle' => $nomebundle,
106 1
            'tabellej' => $tabellej,
107 1
            'nometabella' => $controller,
108 1
            'escludere' => $escludi,);
109
110 1
        if (!empty($prepar)) {
111 1
            $paricevuti = array_merge($paricevuti, $prepar);
112 1
        }
113
114 1
        self::$parametrigriglia = $paricevuti;
115 1
    }
116
117
    /**
118
     * Creates a new table entity.
119
     */
120 1
    public function createAction(Request $request)
121
    {
122 1
        $this->setup($request);
123 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
124 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
125 1
        $controller = $this->getController();
126
127 1
        if (!self::$canCreate) {
128
            throw new AccessDeniedException("Non si hanno i permessi per creare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...creare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
129
        }
130
131 1
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
132 1
        $classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller;
133 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
134
135 1
        $entity = new $classbundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
136 1
        $formType = $formbundle . 'Type';
137
138 1
        $form = $this->createForm(
139 1
            $formType,
140 1
            $entity,
141
            array('attr' => array(
142 1
                'id' => 'formdati' . $controller,
143 1
                ),
144 1
                'action' => $this->generateUrl($controller . '_create'),
145
                )
146 1
        );
147
148 1
        $form->submit($request->request->get($form->getName()));
149
150 1
        if ($form->isValid()) {
151 1
            $em = $this->getDoctrine()->getManager();
152 1
            $em->persist($entity);
153 1
            $em->flush();
154 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
155
156 1
            $continua = (int) $request->get('continua');
157 1
            if ($continua === 0) {
158 1
                return new Response('OK');
159
            } else {
160
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $entity->getId())));
161
            }
162
        }
163
164
        return $this->render(
165
            $nomebundle . ':' . $controller . ':new.html.twig',
166
            array(
167
                    'nomecontroller' => $controller,
168
                    'entity' => $entity,
169
                    'form' => $form->createView(),
170
                        )
171
        );
172
    }
173
174
    /**
175
     * Edits an existing table entity.
176
     */
177 1
    public function updateAction(Request $request, $id)
178
    {
179
        /* @var $em \Doctrine\ORM\EntityManager */
180 1
        $this->setup($request);
181 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
182 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
183 1
        $controller = $this->getController();
184
185 1
        if (!self::$canUpdate) {
186
            throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...ornare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
187
        }
188
189 1
        $nomebundle = $namespace . $bundle . 'Bundle';
190 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
191 1
        $formType = $formbundle . 'Type';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
192
193 1
        $repoStorico = $this->container->get('Storicomodifiche_repository');
194
195 1
        $em = $this->getDoctrine()->getManager();
196
197 1
        $entity = $em->getRepository($nomebundle . ':' . $controller)->find($id);
198
199 1
        if (!$entity) {
200
            throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.');
201
        }
202
203 1
        $deleteForm = $this->createDeleteForm($id);
204
205 1
        $editForm = $this->createForm(
206 1
            $formType,
207 1
            $entity,
208
            array('attr' => array(
209 1
                'id' => 'formdati' . $controller,
210 1
                ),
211 1
                'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
212
                )
213 1
        );
214
215 1
        $editForm->submit($request->request->get($editForm->getName()));
216
217 1
        if ($editForm->isValid()) {
218 1
            $originalData = $em->getUnitOfWork()->getOriginalEntityData($entity);
219
220 1
            $em->persist($entity);
221 1
            $em->flush();
222 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
223
224 1
            $newData = $em->getUnitOfWork()->getOriginalEntityData($entity);
225 1
            $changes = $repoStorico->isRecordChanged($nomebundle, $controller, $originalData, $newData);
226
227 1
            if ($changes) {
228
                $repoStorico->saveHistory($controller, $changes, $id, $this->getUser());
229
            }
230
231 1
            $continua = (int) $request->get('continua');
232 1
            if ($continua === 0) {
233 1
                return new Response('OK');
234
            } else {
235
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id)));
236
            }
237
        }
238
239
        return $this->render(
240
            $nomebundle . ':' . $controller . ':edit.html.twig',
241
            array(
242
                    'entity' => $entity,
243
                    'edit_form' => $editForm->createView(),
244
                    'delete_form' => $deleteForm->createView(),
245
                    'nomecontroller' => $controller,
246
                        )
247
        );
248
    }
249
250
    /**
251
     * Deletes a table entity.
252
     */
253 1
    public function deleteAction(Request $request)
254
    {
255
        /* @var $em \Doctrine\ORM\EntityManager */
256 1
        $this->setup($request);
257 1
        if (!self::$canDelete) {
258
            throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...ornare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
259
        }
260 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
261 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
262 1
        $controller = $this->getController();
263
264 1
        $nomebundle = $namespace . $bundle . 'Bundle';
265
266
        try {
267 1
            $em = $this->getDoctrine()->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
268 1
            $qb = $em->createQueryBuilder();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
269 1
            $ids = explode(',', $request->get('id'));
270 1
            $qb->delete($nomebundle . ':' . $controller, 'u')
271 1
                    ->andWhere('u.id IN (:ids)')
272 1
                    ->setParameter('ids', $ids);
273
274 1
            $query = $qb->getQuery();
275 1
            $query->execute();
276 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
277 1
        } catch (\Exception $e) {
278
            $response = new Response();
279
            $response->setStatusCode('200');
280
281
            return new Response('404');
282
        }
283
284 1
        return new Response('OK');
285
    }
286
}
287