1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
5
|
|
|
* To change this template file, choose Tools | Templates |
6
|
|
|
* and open the template in the editor. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Fi\CoreBundle\Utils; |
10
|
|
|
|
11
|
|
|
final class PermessiSingletonUtility |
12
|
|
|
{ |
13
|
|
|
|
14
|
|
|
private static $PermessiTabelle; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Call this method to get singleton |
18
|
|
|
* |
19
|
|
|
* @return UserFactory |
|
|
|
|
20
|
|
|
*/ |
21
|
16 |
|
public static function instance($em, $modulo, $operatore, $ruolo) |
22
|
|
|
{ |
23
|
16 |
|
static $inst = null; |
24
|
16 |
|
if ($inst === null) { |
25
|
|
|
$inst = new PermessiSingletonUtility($em, $modulo, $operatore, $ruolo); |
26
|
|
|
} |
27
|
16 |
|
return $inst; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Private construct so nobody else can instantiate it |
32
|
|
|
* |
33
|
|
|
*/ |
34
|
|
|
private function __construct($em, $modulo, $operatore, $ruolo) |
35
|
|
|
{ |
36
|
|
|
$q = $em |
37
|
|
|
->getRepository('FiCoreBundle:Permessi') |
38
|
|
|
->findOneBy(array('operatori_id' => $operatore, 'modulo' => $modulo)); |
39
|
|
|
|
40
|
|
|
if (!$q) { |
41
|
|
|
$q = $em |
42
|
|
|
->getRepository('FiCoreBundle:Permessi') |
43
|
|
|
->findOneBy(array('ruoli_id' => $ruolo, 'modulo' => $modulo, 'operatori_id' => null)); |
44
|
|
|
if (!$q) { |
45
|
|
|
$q = $em |
46
|
|
|
->getRepository('FiCoreBundle:Permessi') |
47
|
|
|
->findOneBy(array('ruoli_id' => null, 'modulo' => $modulo, 'operatori_id' => null)); |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
self::$PermessiTabelle = $q; |
52
|
|
|
} |
53
|
|
|
|
54
|
16 |
|
public static function getPermessi() |
55
|
|
|
{ |
56
|
16 |
|
return self::$PermessiTabelle; |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths