EntityStoreFactory::newEntityStore()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Queryr\EntityStore;
4
5
use Doctrine\DBAL\Connection;
6
7
/**
8
 * @licence GNU GPL v2+
9
 * @author Jeroen De Dauw < [email protected] >
10
 */
11
class EntityStoreFactory {
12
13
	private $connection;
14
	private $config;
15
16 1
	public function __construct( Connection $connection, EntityStoreConfig $config ) {
17 1
		$this->connection = $connection;
18 1
		$this->config = $config;
19 1
	}
20
21
	public function newEntityStore() {
22
		return new EntityStore(
23
			$this->newItemStore(),
24
			$this->newPropertyStore()
25
		);
26
	}
27
28
	public function newItemStore() {
29
		return new ItemStore( $this->connection, $this->config->getItemTableName() );
30
	}
31
32
	public function newPropertyStore() {
33
		return new PropertyStore( $this->connection, $this->config->getPropertyTableName() );
34
	}
35
36 1
	public function newPropertyTypeLookup() {
37 1
		return new PropertyTypeLookup( $this->connection, $this->config->getPropertyTableName() );
38
	}
39
40
}