Total Complexity | 11 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class SqliteConnector extends EmbeddedDatabaseConnector |
||
16 | { |
||
17 | protected string $path; |
||
18 | |||
19 | protected bool $memory; |
||
20 | |||
21 | public function __construct () |
||
22 | { |
||
23 | parent::__construct(); |
||
24 | |||
25 | $this->driver = "pdo_sqlite"; |
||
26 | |||
27 | $this->memory = false; |
||
28 | } |
||
29 | |||
30 | public function getPath () : string |
||
33 | } |
||
34 | |||
35 | public function setPath ( string $path ) : void |
||
36 | { |
||
37 | $this->path = $path; |
||
38 | } |
||
39 | |||
40 | public function isMemory () : bool |
||
41 | { |
||
42 | return $this->memory; |
||
43 | } |
||
44 | |||
45 | public function setMemory ( bool $memory ) : void |
||
48 | } |
||
49 | |||
50 | public function getConnectionParameters () : array |
||
51 | { |
||
52 | $this->connectionParameters = [ |
||
53 | "driver" => $this->driver, |
||
54 | "user" => $this->user, |
||
55 | "password" => $this->password |
||
56 | ]; |
||
57 | |||
58 | if ( isset( $this->path ) && $this->path !== "" ) { |
||
59 | $this->connectionParameters["path"] = $this->path; |
||
60 | } |
||
61 | |||
62 | if ( isset( $this->tableName ) && $this->tableName !== "" ) { |
||
63 | $this->connectionParameters["tableName"] = $this->tableName; |
||
64 | } |
||
65 | |||
66 | $this->connectionParameters["memory"] = $this->memory; |
||
67 | |||
68 | return $this->connectionParameters; |
||
69 | } |
||
70 | |||
71 | protected function executeExtraStatements ( Connection $connection ) : void |
||
73 | // TODO: Implement executeExtraStatements() method. |
||
74 | } |
||
75 | } |
||
76 |