|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
4
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
5
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
6
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
7
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
8
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
9
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
10
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
11
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
12
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
13
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
14
|
|
|
* |
|
15
|
|
|
* This software consists of voluntary contributions made by many individuals |
|
16
|
|
|
* and is licensed under the MIT license. For more information, see |
|
17
|
|
|
* <http://www.doctrine-project.org>. |
|
18
|
|
|
*/ |
|
19
|
|
|
|
|
20
|
|
|
namespace DoctrineORMModule\Options; |
|
21
|
|
|
|
|
22
|
|
|
use Zend\Stdlib\AbstractOptions; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Configuration options for an collector |
|
26
|
|
|
* |
|
27
|
|
|
* @license MIT |
|
28
|
|
|
* @link http://www.doctrine-project.org/ |
|
29
|
|
|
* @author Marco Pivetta <[email protected]> |
|
30
|
|
|
*/ |
|
31
|
|
|
class SQLLoggerCollectorOptions extends AbstractOptions |
|
32
|
|
|
{ |
|
33
|
|
|
/** |
|
34
|
|
|
* @var string name to be assigned to the collector |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $name = 'orm_default'; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var string|null service name of the configuration where the logger has to be put |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $configuration; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @var string|null service name of the SQLLogger to be used |
|
45
|
|
|
*/ |
|
46
|
|
|
protected $sqlLogger; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param string $name |
|
50
|
|
|
*/ |
|
51
|
2 |
|
public function setName($name) |
|
52
|
|
|
{ |
|
53
|
2 |
|
$this->name = (string) $name; |
|
54
|
2 |
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Name of the collector |
|
58
|
|
|
* |
|
59
|
|
|
* @return string |
|
60
|
|
|
*/ |
|
61
|
6 |
|
public function getName() |
|
62
|
|
|
{ |
|
63
|
6 |
|
return $this->name; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @param string|null $configuration |
|
68
|
|
|
*/ |
|
69
|
2 |
|
public function setConfiguration($configuration) |
|
70
|
|
|
{ |
|
71
|
2 |
|
$this->configuration = $configuration ? (string) $configuration : null; |
|
72
|
2 |
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* Configuration service name (where to set the logger) |
|
76
|
|
|
* |
|
77
|
|
|
* @return string |
|
78
|
|
|
*/ |
|
79
|
6 |
|
public function getConfiguration() |
|
80
|
|
|
{ |
|
81
|
6 |
|
return $this->configuration ? $this->configuration : 'doctrine.configuration.orm_default'; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param string|null $sqlLogger |
|
86
|
|
|
*/ |
|
87
|
3 |
|
public function setSqlLogger($sqlLogger) |
|
88
|
|
|
{ |
|
89
|
3 |
|
$this->sqlLogger = $sqlLogger ? (string) $sqlLogger : null; |
|
90
|
3 |
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* SQLLogger service name |
|
94
|
|
|
* |
|
95
|
|
|
* @return string|null |
|
96
|
|
|
*/ |
|
97
|
6 |
|
public function getSqlLogger() |
|
98
|
|
|
{ |
|
99
|
6 |
|
return $this->sqlLogger; |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|