1 | <?php |
||
10 | class DatabaseSandbox |
||
11 | { |
||
12 | const SANDBOXED_DATABASE_NAME_PATTERN = '%s_%s'; |
||
13 | |||
14 | /** |
||
15 | * @var bool |
||
16 | */ |
||
17 | private $sandboxEnabled = true; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $databaseNames = []; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $sandboxDatabaseNames = []; |
||
28 | |||
29 | 5 | public function __construct(bool $sandboxEnabled = false, array $databaseNames = []) |
|
34 | |||
35 | public function getSandboxEnabled() : bool |
||
39 | |||
40 | public function setSandboxEnabled(bool $sandboxEnabled) |
||
41 | { |
||
42 | $this->sandboxEnabled = $sandboxEnabled; |
||
43 | } |
||
44 | |||
45 | 2 | public function getDatabaseNames() : array |
|
49 | |||
50 | 2 | public function setDatabaseNames(array $databaseNames) |
|
54 | |||
55 | 1 | public function getTestDatabaseNames() : array |
|
67 | |||
68 | 1 | public function getSandboxedDatabaseNames() : array |
|
74 | |||
75 | protected function generateUniqueId() : string |
||
79 | |||
80 | 1 | private function initialize() |
|
86 | |||
87 | 1 | private function generateDatabaseNames() : array |
|
105 | } |
||
106 |