1 | <?php |
||
8 | abstract class AbstractDatabase implements LoggerAwareInterface, ReadableInterface, WritableInterface |
||
9 | { |
||
10 | |||
11 | private $logger; |
||
12 | |||
13 | /** |
||
14 | * Instantiates the AbstractDatabase. Should be called from inheritors. |
||
15 | */ |
||
16 | 40 | public function __construct() |
|
20 | |||
21 | /** |
||
22 | * @param string $table The table that will be accessed and written. |
||
23 | * @return array|null |
||
24 | */ |
||
25 | 3 | public function find($table, Condition $criteria = null, array $options = []) |
|
35 | |||
36 | /** |
||
37 | * Returns the current logger object. |
||
38 | * |
||
39 | * @return LoggerInterface |
||
40 | */ |
||
41 | 2 | public function getLogger() |
|
45 | |||
46 | /** |
||
47 | * Sets the logger to $value. |
||
48 | * |
||
49 | * @param LoggerInterface $value A logger to be used for this database. |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function setLogger(LoggerInterface $value) |
||
61 | |||
62 | /** |
||
63 | * Returns the id of the last record created, or null if no creation took place. |
||
64 | * |
||
65 | * Must be implemented by inheritors. |
||
66 | * |
||
67 | * @return mixed |
||
68 | */ |
||
69 | abstract public function lastIdCreated(); |
||
70 | } |
||
71 |