1 | <?php |
||
12 | class Database |
||
13 | { |
||
14 | /** |
||
15 | * @var Operator |
||
16 | */ |
||
17 | private $db; |
||
18 | /** |
||
19 | * Name of original database. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $source = ''; |
||
24 | /** |
||
25 | * Name of temporary database that will store data from original. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $temporary = ''; |
||
30 | /** |
||
31 | * Indicates that DB was cloned. |
||
32 | * |
||
33 | * @var bool |
||
34 | */ |
||
35 | private $cloned = false; |
||
36 | |||
37 | /** |
||
38 | * @param string $connection |
||
39 | * Database connection name (key in $databases array from settings.php). |
||
40 | */ |
||
41 | 4 | public function __construct($connection) |
|
61 | |||
62 | /** |
||
63 | * Clone a database. |
||
64 | */ |
||
65 | 4 | public function __clone() |
|
71 | |||
72 | /** |
||
73 | * Restore original database. |
||
74 | */ |
||
75 | 4 | public function __destruct() |
|
84 | } |
||
85 |