1 | <?php |
||
8 | class User extends GhostModel |
||
9 | { |
||
10 | /** |
||
11 | * The primary id or some other id that can be used to fetch user information. |
||
12 | * @var string |
||
13 | */ |
||
14 | public $id; |
||
15 | |||
16 | /** |
||
17 | * @var UserIdentifiers |
||
18 | */ |
||
19 | protected $_identifiers; |
||
20 | |||
21 | /** |
||
22 | * User constructor. |
||
23 | * |
||
24 | * @param Client $client |
||
25 | * @param string $id |
||
26 | */ |
||
27 | public function __construct(Client $client, $id) |
||
32 | |||
33 | /** |
||
34 | * Get the user id the object was constructed with. This might or might not be the primary id. |
||
35 | * The only usefulness of this method over getPrimaryId() is that it will not trigger loading of the full object. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function getUserId() |
||
43 | |||
44 | /** |
||
45 | * Get the primary id. No need to load the full record for this. |
||
46 | * |
||
47 | * @return string|null |
||
48 | */ |
||
49 | public function getPrimaryId() |
||
53 | |||
54 | /** |
||
55 | * Get the user identifiers. |
||
56 | * |
||
57 | * @return UserIdentifiers |
||
58 | */ |
||
59 | public function getIdentifiers() |
||
63 | |||
64 | /** |
||
65 | * Check if we have the full representation of our data object. |
||
66 | * |
||
67 | * @param \stdClass $data |
||
68 | * @return boolean |
||
69 | */ |
||
70 | protected function isInitialized($data) |
||
74 | |||
75 | /** |
||
76 | * Store data onto object. |
||
77 | * |
||
78 | * @param \stdClass $data |
||
79 | */ |
||
80 | protected function setData(\stdClass $data) |
||
84 | |||
85 | |||
86 | /** |
||
87 | * Generate the base URL for this resource. |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | protected function urlBase() |
||
95 | |||
96 | public function __get($key) |
||
125 | } |
||
126 |
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.