Configuration::getTargetEntityClassName()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * This file is part of the Kdyby (http://www.kdyby.org)
5
 *
6
 * Copyright (c) 2008 Filip Procházka ([email protected])
7
 *
8
 * For the full copyright and license information, please view the file license.txt that was distributed with this source code.
9
 */
10
11
namespace Kdyby\Doctrine;
12
13
use Doctrine;
14
use Doctrine\ORM\Configuration as BaseConfiguration;
15
use Kdyby;
16
use Nette;
17
18
19
20
/**
21
 * @author Michal Gebauer <[email protected]>
22
 */
23
class Configuration extends BaseConfiguration
24
{
25
26
	public function getQueryBuilderClassName()
27
	{
28
		return isset($this->_attributes['queryBuilderClass'])
29
			? $this->_attributes['queryBuilderClass']
30
			: Kdyby\Doctrine\QueryBuilder::class;
31
	}
32
33
34
35
	public function setQueryBuilderClassName($className)
36
	{
37
		$this->_attributes['queryBuilderClass'] = $className;
38
	}
39
40
41
42
	public function setTargetEntityMap($targetEntityMap)
43
	{
44
		$this->_attributes['targetEntityMap'] = $targetEntityMap;
45
	}
46
47
48
49
	public function getTargetEntityClassName($className)
50
	{
51
		return isset($this->_attributes['targetEntityMap'], $this->_attributes['targetEntityMap'][$className])
52
			? $this->_attributes['targetEntityMap'][$className]
53
			: $className;
54
	}
55
56
}
57