1 | <?php |
||
32 | class Server extends Model |
||
33 | { |
||
34 | use Notifiable, SoftDeletes; |
||
35 | |||
36 | /** |
||
37 | * The table associated with the model. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $table = 'servers'; |
||
42 | |||
43 | /** |
||
44 | * The attributes excluded from the model's JSON form. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $hidden = ['daemonSecret', 'sftp_password']; |
||
49 | |||
50 | /** |
||
51 | * The attributes that should be mutated to dates. |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | protected $dates = ['deleted_at']; |
||
56 | |||
57 | /** |
||
58 | * Fields that are not mass assignable. |
||
59 | * |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $guarded = ['id', 'installed', 'created_at', 'updated_at', 'deleted_at']; |
||
63 | |||
64 | /** |
||
65 | * Cast values to correct type. |
||
66 | * |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $casts = [ |
||
70 | 'node' => 'integer', |
||
71 | 'suspended' => 'integer', |
||
72 | 'owner' => 'integer', |
||
73 | 'memory' => 'integer', |
||
74 | 'swap' => 'integer', |
||
75 | 'disk' => 'integer', |
||
76 | 'io' => 'integer', |
||
77 | 'cpu' => 'integer', |
||
78 | 'oom_disabled' => 'integer', |
||
79 | 'port' => 'integer', |
||
80 | 'service' => 'integer', |
||
81 | 'option' => 'integer', |
||
82 | 'installed' => 'integer', |
||
83 | ]; |
||
84 | |||
85 | /** |
||
86 | * @var array |
||
87 | */ |
||
88 | protected static $serverUUIDInstance = []; |
||
89 | |||
90 | /** |
||
91 | * @var mixed |
||
92 | */ |
||
93 | protected static $user; |
||
94 | |||
95 | /** |
||
96 | * Constructor. |
||
97 | */ |
||
98 | public function __construct() |
||
103 | |||
104 | /** |
||
105 | * Determine if we need to change the server's daemonSecret value to |
||
106 | * match that of the user if they are a subuser. |
||
107 | * |
||
108 | * @param Illuminate\Database\Eloquent\Model\Server $server |
||
109 | * @return string |
||
110 | */ |
||
111 | public static function getUserDaemonSecret(Server $server) |
||
125 | |||
126 | /** |
||
127 | * Returns array of all servers owned by the logged in user. |
||
128 | * Returns all users servers if user is a root admin. |
||
129 | * |
||
130 | * @return \Illuminate\Database\Eloquent\Collection |
||
131 | */ |
||
132 | public static function getUserServers($paginate = null) |
||
159 | |||
160 | /** |
||
161 | * Returns a single server specified by UUID. |
||
162 | * DO NOT USE THIS TO MODIFY SERVER DETAILS OR SAVE THOSE DETAILS. |
||
163 | * YOU WILL OVERWRITE THE SECRET KEY AND BREAK THINGS. |
||
164 | * |
||
165 | * @param string $uuid The Short-UUID of the server to return an object about. |
||
166 | * @return \Illuminate\Database\Eloquent\Collection |
||
167 | */ |
||
168 | public static function getByUUID($uuid) |
||
193 | |||
194 | /** |
||
195 | * Returns non-administrative headers for accessing a server on the daemon. |
||
196 | * |
||
197 | * @param string $uuid |
||
198 | * @return array |
||
199 | */ |
||
200 | public static function getGuzzleHeaders($uuid) |
||
211 | |||
212 | /** |
||
213 | * Gets all allocations associated with this server. |
||
214 | * |
||
215 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
216 | */ |
||
217 | public function allocations() |
||
221 | |||
222 | /** |
||
223 | * Gets information for the pack associated with this server. |
||
224 | * |
||
225 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
226 | */ |
||
227 | public function pack() |
||
231 | |||
232 | /** |
||
233 | * Gets information for the service associated with this server. |
||
234 | * |
||
235 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
236 | */ |
||
237 | public function service() |
||
241 | |||
242 | /** |
||
243 | * Gets information for the service option associated with this server. |
||
244 | * |
||
245 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
246 | */ |
||
247 | public function option() |
||
251 | |||
252 | /** |
||
253 | * Gets information for the service variables associated with this server. |
||
254 | * |
||
255 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
256 | */ |
||
257 | public function variables() |
||
261 | } |
||
262 |
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.