SQLStoreWithDependencies::newInstaller()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Wikibase\QueryEngine\SQLStore;
4
5
use Doctrine\DBAL\Connection;
6
use Wikibase\DataModel\Entity\EntityIdParser;
7
use Wikibase\QueryEngine\PropertyDataValueTypeLookup;
8
use Wikibase\QueryEngine\QueryStoreWithDependencies;
9
10
class SQLStoreWithDependencies implements QueryStoreWithDependencies {
11
12
	private $factory;
13
	private $connection;
14
	private $lookup;
15
	private $idParser;
16
17
	public function __construct( SQLStore $factory, Connection $connection,
18
		PropertyDataValueTypeLookup $lookup, EntityIdParser $idParser ) {
19
20
		$this->factory = $factory;
21
		$this->connection = $connection;
22
		$this->lookup = $lookup;
23
		$this->idParser = $idParser;
24
	}
25
26
	public function newQueryEngine() {
27
		return $this->factory->newQueryEngine( $this->connection, $this->lookup, $this->idParser );
28
	}
29
30
	public function newWriter() {
31
		return $this->factory->newWriter( $this->connection );
32
	}
33
34
	public function newInstaller() {
35
		return $this->factory->newInstaller( $this->connection->getSchemaManager() );
36
	}
37
38
	public function newUninstaller() {
39
		return $this->factory->newUninstaller( $this->connection->getSchemaManager() );
40
	}
41
42
	public function newUpdater() {
43
		return $this->factory->newUpdater( $this->connection->getSchemaManager() );
44
	}
45
46
	public function __destruct() {
47
		$this->connection->close();
48
	}
49
50
}
51