1 | <?php |
||
4 | class SQLPendingUser extends PendingUser |
||
5 | { |
||
6 | private $hash; |
||
7 | private $time; |
||
8 | private $blob; |
||
9 | private $table; |
||
10 | |||
11 | public function __construct($data, $table = false) |
||
12 | { |
||
13 | $this->hash = $data['hash']; |
||
14 | $this->time = new \DateTime($data['time']); |
||
15 | $this->blob = json_decode($data['data']); |
||
16 | $this->table = $table; |
||
17 | } |
||
18 | |||
19 | public function __get($propName) |
||
20 | { |
||
21 | if(is_array($this->blob->{$propName})) |
||
22 | { |
||
23 | return $this->blob->{$propName}[0]; |
||
24 | } |
||
25 | return $this->blob->{$propName}; |
||
26 | } |
||
27 | |||
28 | public function __set($propName, $value) |
||
29 | { |
||
30 | } |
||
31 | |||
32 | public function __isset($propName) |
||
33 | { |
||
34 | return isset($this->block->{$propName}); |
||
|
|||
35 | } |
||
36 | |||
37 | public function getHash() |
||
38 | { |
||
39 | return $this->hash; |
||
40 | } |
||
41 | |||
42 | public function getRegistrationTime() |
||
43 | { |
||
44 | return $this->time; |
||
45 | } |
||
46 | |||
47 | public function getPassword() |
||
55 | |||
56 | public function offsetGet($offset) |
||
60 | |||
61 | public function delete() |
||
65 | } |
||
66 | |||
67 |
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.