StoricomodificheController::modificheAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 24
ccs 0
cts 15
cp 0
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Fi\CoreBundle\Controller;
4
5
use Symfony\Component\HttpFoundation\Request;
6
7
/**
8
 * Storicomodifiche controller.
9
 *
10
 */
11
class StoricomodificheController extends FiCoreController
12
{
13
14
    public function modificheAction(Request $request)
15
    {
16
        $nometabella = $request->get("nometabella");
17
        $nomecampo = $request->get("nomecampo");
18
        $id = (int) $request->get("id");
19
20
        $this->setup($request);
21
        $namespace = $this->getNamespace();
22
        $bundle = $this->getBundle();
23
        $controller = $this->getController();
24
25
        $nomebundle = $namespace . $bundle . 'Bundle';
26
27
        $em = $this->getDoctrine()->getManager();
28
29
        $entity = $em->getRepository($nomebundle . ':' . $controller)->findBy(
30
            array(
31
                    'nometabella' => $nometabella,
32
                    'nomecampo' => $nomecampo,
33
                    'idtabella' => $id,
34
                )
35
        );
36
37
        return $this->render('FiCoreBundle:Storicomodifiche:modifiche.html.twig', array("modifiche" => $entity));
38
    }
39
}
40