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 | 'public', 'name', 'location_id', |
||
70 | 'fqdn', 'scheme', 'memory', |
||
71 | 'memory_overallocate', 'disk', |
||
72 | 'disk_overallocate', 'upload_size', |
||
73 | 'daemonSecret', 'daemonBase', |
||
74 | 'daemonSFTP', 'daemonListen', |
||
75 | ]; |
||
76 | |||
77 | /** |
||
78 | * Return an instance of the Guzzle client for this specific node. |
||
79 | * |
||
80 | * @param array $headers |
||
81 | * @return \GuzzleHttp\Client |
||
82 | */ |
||
83 | public function guzzleClient($headers = []) |
||
92 | |||
93 | /** |
||
94 | * Returns the configuration in JSON format. |
||
95 | * |
||
96 | * @param bool $pretty Wether to pretty print the JSON or not |
||
97 | * @return string The configration in JSON format |
||
98 | */ |
||
99 | public function getConfigurationAsJson($pretty = false) |
||
144 | |||
145 | /** |
||
146 | * Gets the location associated with a node. |
||
147 | * |
||
148 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
149 | */ |
||
150 | public function location() |
||
154 | |||
155 | /** |
||
156 | * Gets the servers associated with a node. |
||
157 | * |
||
158 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
159 | */ |
||
160 | public function servers() |
||
164 | |||
165 | /** |
||
166 | * Gets the allocations associated with a node. |
||
167 | * |
||
168 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
169 | */ |
||
170 | public function allocations() |
||
174 | } |
||
175 |
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.