Conditions | 1 |
Paths | 1 |
Total Lines | 45 |
Code Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | public function init() |
||
17 | { |
||
18 | // $this->db->setVerbose(); |
||
19 | $this->db->dropTableIfExists('user')->execute(); |
||
|
|||
20 | |||
21 | $this->db->createTable( |
||
22 | 'user', |
||
23 | [ |
||
24 | 'id' => ['integer', 'primary key', 'not null', 'auto_increment'], |
||
25 | 'acronym' => ['varchar(20)', 'unique', 'not null'], |
||
26 | 'email' => ['varchar(80)'], |
||
27 | 'name' => ['varchar(80)'], |
||
28 | 'password' => ['varchar(255)'], |
||
29 | 'created' => ['datetime'], |
||
30 | 'updated' => ['datetime'], |
||
31 | 'deleted' => ['datetime'], |
||
32 | 'active' => ['datetime'], |
||
33 | ] |
||
34 | )->execute(); |
||
35 | $this->db->insert( |
||
36 | 'user', |
||
37 | ['acronym', 'email', 'name', 'password', 'created', 'active'] |
||
38 | ); |
||
39 | |||
40 | $now = gmdate('Y-m-d H:i:s'); |
||
41 | |||
42 | $this->db->execute([ |
||
43 | 'admin', |
||
44 | '[email protected]', |
||
45 | 'Administrator', |
||
46 | password_hash('admin', PASSWORD_DEFAULT), |
||
47 | $now, |
||
48 | $now |
||
49 | ]); |
||
50 | |||
51 | $this->db->execute([ |
||
52 | 'doe', |
||
53 | '[email protected]', |
||
54 | 'John/Jane Doe', |
||
55 | password_hash('doe', PASSWORD_DEFAULT), |
||
56 | $now, |
||
57 | $now |
||
58 | ]); |
||
59 | |||
60 | } |
||
61 | } |
||
62 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.