Completed
Push — master ( 50808e...33b518 )
by Gianluca
05:07
created

DBALConfiguration::setSqlLogger()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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 a DBAL Connection
26
 *
27
 * @license MIT
28
 * @link    http://www.doctrine-project.org/
29
 * @author  Kyle Spraggs <[email protected]>
30
 */
31
class DBALConfiguration extends AbstractOptions
32
{
33
    /**
34
     * Set the cache key for the result cache. Cache key
35
     * is assembled as "doctrine.cache.{key}" and pulled from
36
     * service locator.
37
     *
38
     * @var string
39
     */
40
    protected $resultCache = 'array';
41
42
    /**
43
     * Set the class name of the SQL Logger, or null, to disable.
44
     *
45
     * @var string
46
     */
47
    protected $sqlLogger = null;
48
49
    /**
50
     * Keys must be the name of the type identifier and value is
51
     * the class name of the Type
52
     *
53
     * @var array
54
     */
55
    protected $types = array();
56
57
    /**
58
     * @param string $resultCache
59
     */
60
    public function setResultCache($resultCache)
61
    {
62
        $this->resultCache = $resultCache;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getResultCache()
69
    {
70
        return 'doctrine.cache.' . $this->resultCache;
71
    }
72
73
    /**
74
     * @param string $sqlLogger
75
     */
76
    public function setSqlLogger($sqlLogger)
77
    {
78
        $this->sqlLogger = $sqlLogger;
79
    }
80
81
    /**
82
     * @return string
83
     */
84 69
    public function getSqlLogger()
85
    {
86 69
        return $this->sqlLogger;
87
    }
88
89
    /**
90
     * @param array $types
91
     */
92
    public function setTypes(array $types)
93
    {
94
        $this->types = $types;
95
    }
96
97
    /**
98
     * @return string
99
     */
100 69
    public function getTypes()
101
    {
102 69
        return $this->types;
103
    }
104
}
105