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.
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>.
20 namespace Doctrine\DBAL;
22 use Doctrine\DBAL\Logging\SQLLogger;
23 use Doctrine\Common\Cache\Cache;
26 * Configuration container for the Doctrine DBAL.
29 * @author Guilherme Blanco <guilhermeblanco@hotmail.com>
30 * @author Jonathan Wage <jonwage@gmail.com>
31 * @author Roman Borschel <roman@code-factory.org>
32 * @internal When adding a new configuration option just write a getter/setter
33 * pair and add the option to the _attributes array with a proper default value.
38 * The attributes that are contained in the configuration.
39 * Values are default values.
43 protected $_attributes = array();
46 * Sets the SQL logger to use. Defaults to NULL which means SQL logging is disabled.
48 * @param SQLLogger $logger
50 public function setSQLLogger(SQLLogger $logger = null)
52 $this->_attributes['sqlLogger'] = $logger;
56 * Gets the SQL logger that is used.
60 public function getSQLLogger()
62 return isset($this->_attributes['sqlLogger']) ?
63 $this->_attributes['sqlLogger'] : null;
67 * Gets the cache driver implementation that is used for query result caching.
69 * @return \Doctrine\Common\Cache\Cache
71 public function getResultCacheImpl()
73 return isset($this->_attributes['resultCacheImpl']) ?
74 $this->_attributes['resultCacheImpl'] : null;
78 * Sets the cache driver implementation that is used for query result caching.
80 * @param \Doctrine\Common\Cache\Cache $cacheImpl
82 public function setResultCacheImpl(Cache $cacheImpl)
84 $this->_attributes['resultCacheImpl'] = $cacheImpl;
88 * Filter schema assets expression.
90 * Only include tables/sequences matching the filter expression regexp in
91 * schema instances generated for the active connection when calling
92 * {AbstractSchemaManager#createSchema()}.
94 * @param string $filterExpression
96 public function setFilterSchemaAssetsExpression($filterExpression)
98 $this->_attributes['filterSchemaAssetsExpression'] = $filterExpression;
102 * Return filter schema assets expression.
104 * @return string|null
106 public function getFilterSchemaAssetsExpression()
108 if (isset($this->_attributes['filterSchemaAssetsExpression'])) {
109 return $this->_attributes['filterSchemaAssetsExpression'];