|
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 TabelleSingletonUtility |
|
12
|
|
|
{ |
|
13
|
|
|
|
|
14
|
|
|
private static $queryTabelle; |
|
15
|
|
|
private static $nometabella; |
|
16
|
|
|
private static $operatore; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Call this method to get singleton |
|
20
|
|
|
* |
|
21
|
|
|
* @return UserFactory |
|
|
|
|
|
|
22
|
|
|
*/ |
|
23
|
17 |
|
public static function instance($em, $nometabella, $operatore) |
|
24
|
|
|
{ |
|
25
|
17 |
|
static $inst = null; |
|
26
|
17 |
|
if ($inst === null) { |
|
27
|
|
|
self::$nometabella = $nometabella; |
|
28
|
|
|
self::$operatore = $operatore; |
|
|
|
|
|
|
29
|
|
|
$inst = new TabelleSingletonUtility($em, $nometabella, $operatore); |
|
|
|
|
|
|
30
|
|
|
} |
|
31
|
17 |
|
if ($nometabella != self::$nometabella || $operatore != self::$operatore) { |
|
32
|
10 |
|
self::$nometabella = $nometabella; |
|
33
|
10 |
|
self::$operatore = $operatore; |
|
|
|
|
|
|
34
|
10 |
|
$inst = new TabelleSingletonUtility($em, $nometabella, $operatore); |
|
|
|
|
|
|
35
|
10 |
|
} |
|
36
|
17 |
|
return $inst; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Private construct so nobody else can instantiate it |
|
41
|
|
|
* |
|
42
|
|
|
*/ |
|
43
|
10 |
|
private function __construct($em, $nometabella, $operatore) |
|
44
|
|
|
{ |
|
45
|
10 |
|
self::$queryTabelle = $em->getRepository('FiCoreBundle:Tabelle')->findBy(array('operatori_id' => $operatore, 'nometabella' => $nometabella)); |
|
46
|
|
|
|
|
47
|
10 |
|
if (!self::$queryTabelle) { |
|
48
|
10 |
|
self::$queryTabelle = $em->getRepository('FiCoreBundle:Tabelle')->findBy(array('operatori_id' => null, 'nometabella' => $nometabella)); |
|
49
|
10 |
|
} |
|
50
|
10 |
|
} |
|
51
|
|
|
|
|
52
|
17 |
|
public static function getTabelle() |
|
53
|
|
|
{ |
|
54
|
17 |
|
return self::$queryTabelle; |
|
55
|
|
|
} |
|
56
|
|
|
} |
|
57
|
|
|
|
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