Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
31 | 8 | public function __construct( \PDO $pdo, string $table_name, AddressFactory $address_factory = null ) |
|
32 | { |
||
33 | 8 | $this->address_factory = $address_factory ?: new AddressFactory; |
|
34 | |||
35 | 8 | $sql = "SELECT " . implode(",", static::$DB_FIELDS) ." |
|
36 | 8 | FROM {$table_name} |
|
37 | WHERE id = :id"; |
||
38 | |||
39 | 8 | $this->stmt = $pdo->prepare( $sql ); |
|
40 | 8 | $this->stmt->setFetchMode(\PDO::FETCH_CLASS, PdoAddress::class); |
|
41 | 8 | } |
|
42 | |||
51 | } |