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