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 | * @var array |
||
79 | */ |
||
80 | protected static $guzzle = []; |
||
81 | |||
82 | /** |
||
83 | * @var array |
||
84 | */ |
||
85 | protected static $nodes = []; |
||
86 | |||
87 | /** |
||
88 | * Returns an instance of the database object for the requested node ID. |
||
89 | * |
||
90 | * @param int $id |
||
91 | * @return \Illuminate\Database\Eloquent\Model |
||
92 | */ |
||
93 | public static function getByID($id) |
||
105 | |||
106 | /** |
||
107 | * Return an instance of the Guzzle client for this specific node. |
||
108 | * |
||
109 | * @param array $headers |
||
110 | * @return \GuzzleHttp\Client |
||
111 | */ |
||
112 | public function guzzleClient($headers = []) |
||
121 | |||
122 | /** |
||
123 | * Returns a Guzzle Client for the node in question. |
||
124 | * |
||
125 | * @param int $node |
||
126 | * @return \GuzzleHttp\Client |
||
127 | * @deprecated |
||
128 | */ |
||
129 | public static function guzzleRequest($node) |
||
147 | |||
148 | /** |
||
149 | * Returns the configuration in JSON format. |
||
150 | * |
||
151 | * @param bool $pretty Wether to pretty print the JSON or not |
||
152 | * @return string The configration in JSON format |
||
153 | */ |
||
154 | public function getConfigurationAsJson($pretty = false) |
||
204 | |||
205 | /** |
||
206 | * Gets the location associated with a node. |
||
207 | * |
||
208 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
209 | */ |
||
210 | public function location() |
||
214 | |||
215 | /** |
||
216 | * Gets the servers associated with a node. |
||
217 | * |
||
218 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
219 | */ |
||
220 | public function servers() |
||
224 | |||
225 | /** |
||
226 | * Gets the allocations associated with a node. |
||
227 | * |
||
228 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
229 | */ |
||
230 | public function allocations() |
||
234 | } |
||
235 |
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.