1 | <?php |
||
29 | class ServiceOption extends Model |
||
30 | { |
||
31 | /** |
||
32 | * The table associated with the model. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $table = 'service_options'; |
||
37 | |||
38 | /** |
||
39 | * Fields that are not mass assignable. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $guarded = ['id', 'created_at', 'updated_at']; |
||
44 | |||
45 | /** |
||
46 | * Cast values to correct type. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $casts = [ |
||
51 | 'service_id' => 'integer', |
||
52 | 'script_is_privileged' => 'boolean', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * Returns the display startup string for the option and will use the parent |
||
57 | * service one if the option does not have one defined. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getDisplayStartupAttribute($value) |
||
65 | |||
66 | /** |
||
67 | * Returns the install script for the option; if option is copying from another |
||
68 | * it will return the copied script. |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getCopyScriptInstallAttribute($value) |
||
76 | |||
77 | /** |
||
78 | * Returns the entry command for the option; if option is copying from another |
||
79 | * it will return the copied entry command. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getCopyScriptEntryAttribute($value) |
||
87 | |||
88 | /** |
||
89 | * Returns the install container for the option; if option is copying from another |
||
90 | * it will return the copied install container. |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getCopyScriptContainerAttribute($value) |
||
98 | |||
99 | /** |
||
100 | * Gets service associated with a service option. |
||
101 | * |
||
102 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
103 | */ |
||
104 | public function service() |
||
108 | |||
109 | /** |
||
110 | * Gets all servers associated with this service option. |
||
111 | * |
||
112 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
113 | */ |
||
114 | public function servers() |
||
118 | |||
119 | /** |
||
120 | * Gets all variables associated with this service. |
||
121 | * |
||
122 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
123 | */ |
||
124 | public function variables() |
||
128 | |||
129 | /** |
||
130 | * Gets all packs associated with this service. |
||
131 | * |
||
132 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
133 | */ |
||
134 | public function packs() |
||
138 | |||
139 | public function copyFrom() |
||
143 | } |
||
144 |