Total Complexity | 4 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
9 | class MapperFactory implements CanCreateMapper |
||
10 | { |
||
11 | |||
12 | private $connection; |
||
13 | private $cache = []; |
||
14 | private $table; |
||
15 | |||
16 | /** |
||
17 | * Creates new factory instance |
||
18 | * |
||
19 | * @param PDO $connection |
||
20 | * @param string $table A list of table name aliases |
||
21 | */ |
||
22 | 27 | public function __construct(PDO $connection, string $table) |
|
23 | { |
||
24 | 27 | $this->connection = $connection; |
|
25 | 27 | $this->table = $table; |
|
26 | 27 | } |
|
27 | |||
28 | |||
29 | /** |
||
30 | * Method for retrieving an SQL data mapper instance |
||
31 | * |
||
32 | * @param string $className Fully qualified class name of the mapper |
||
33 | * |
||
34 | * @throws RuntimeException if mapper's class can't be found |
||
35 | * |
||
36 | * @return DataMapper |
||
37 | */ |
||
38 | 27 | public function create(string $className) |
|
52 | } |
||
53 | |||
55 |