| 1 | <?php |
||
| 12 | abstract class Database |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var DatabaseContainer |
||
| 16 | */ |
||
| 17 | protected $container; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * The typical use-case is to omit the `$factory` argument - it exists primarily for |
||
| 21 | * mocking and dependency-injection under test. |
||
| 22 | * |
||
| 23 | * @param DatabaseContainerFactory|null $factory custom factory instance (typically omitted) |
||
| 24 | */ |
||
| 25 | 1 | public function __construct(DatabaseContainerFactory $factory = null) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * @return DatabaseContainer |
||
| 38 | */ |
||
| 39 | abstract protected function bootstrap(DatabaseContainerFactory $factory); |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param string Schema class-name |
||
| 43 | * |
||
| 44 | * @return Schema |
||
| 45 | */ |
||
| 46 | 1 | public function getSchema($schema) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $sql |
||
| 53 | * |
||
| 54 | * @return SQLQuery |
||
| 55 | */ |
||
| 56 | 1 | public function sql($sql) |
|
| 60 | } |
||
| 61 |