1 | <?php |
||
31 | class Node extends Model |
||
32 | { |
||
33 | use Notifiable; |
||
34 | |||
35 | /** |
||
36 | * The table associated with the model. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $table = 'nodes'; |
||
41 | |||
42 | /** |
||
43 | * The attributes excluded from the model's JSON form. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $hidden = ['daemonSecret']; |
||
48 | |||
49 | /** |
||
50 | * Cast values to correct type. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | protected $casts = [ |
||
55 | 'public' => 'integer', |
||
56 | 'location_id' => 'integer', |
||
57 | 'memory' => 'integer', |
||
58 | 'disk' => 'integer', |
||
59 | 'daemonListen' => 'integer', |
||
60 | 'daemonSFTP' => 'integer', |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * Fields that are mass assignable. |
||
65 | * |
||
66 | * @var array |
||
67 | */ |
||
68 | protected $fillable = [ |
||
69 | 'uuid', |
||
70 | 'uuidShort', |
||
71 | 'node_id', |
||
72 | 'name', |
||
73 | 'suspended', |
||
74 | 'owner_id', |
||
75 | 'memory', |
||
76 | 'swap', |
||
77 | 'disk', |
||
78 | 'io', |
||
79 | 'cpu', |
||
80 | 'oom_disabled', |
||
81 | 'allocation_id', |
||
82 | 'service_id', |
||
83 | 'option_id', |
||
84 | 'pack_id', |
||
85 | 'startup', |
||
86 | 'daemonSecret', |
||
87 | 'image', |
||
88 | 'username', |
||
89 | 'sftp_password', |
||
90 | 'installed', |
||
91 | ]; |
||
92 | |||
93 | /** |
||
94 | * @var array |
||
95 | */ |
||
96 | protected static $guzzle = []; |
||
97 | |||
98 | /** |
||
99 | * @var array |
||
100 | */ |
||
101 | protected static $nodes = []; |
||
102 | |||
103 | /** |
||
104 | * Returns an instance of the database object for the requested node ID. |
||
105 | * |
||
106 | * @param int $id |
||
107 | * @return \Illuminate\Database\Eloquent\Model |
||
108 | */ |
||
109 | public static function getByID($id) |
||
121 | |||
122 | /** |
||
123 | * Return an instance of the Guzzle client for this specific node. |
||
124 | * |
||
125 | * @param array $headers |
||
126 | * @return \GuzzleHttp\Client |
||
127 | */ |
||
128 | public function guzzleClient($headers = []) |
||
137 | |||
138 | /** |
||
139 | * Returns a Guzzle Client for the node in question. |
||
140 | * |
||
141 | * @param int $node |
||
142 | * @return \GuzzleHttp\Client |
||
143 | * @deprecated |
||
144 | */ |
||
145 | public static function guzzleRequest($node) |
||
163 | |||
164 | /** |
||
165 | * Returns the configuration in JSON format. |
||
166 | * |
||
167 | * @param bool $pretty Wether to pretty print the JSON or not |
||
168 | * @return string The configration in JSON format |
||
169 | */ |
||
170 | public function getConfigurationAsJson($pretty = false) |
||
220 | |||
221 | /** |
||
222 | * Gets the location associated with a node. |
||
223 | * |
||
224 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
225 | */ |
||
226 | public function location() |
||
230 | |||
231 | /** |
||
232 | * Gets the servers associated with a node. |
||
233 | * |
||
234 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
235 | */ |
||
236 | public function servers() |
||
240 | |||
241 | /** |
||
242 | * Gets the allocations associated with a node. |
||
243 | * |
||
244 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
245 | */ |
||
246 | public function allocations() |
||
250 | } |
||
251 |
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.