1 | <?php namespace Anomaly\PreferencesModule\Preference; |
||
22 | class PreferenceModel extends PreferencesPreferencesEntryModel implements PreferenceInterface |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Return the value field. |
||
27 | * |
||
28 | * @return FieldType |
||
29 | */ |
||
30 | public function field() |
||
41 | |||
42 | /** |
||
43 | * Limit to preferences belonging to the provided user. |
||
44 | * |
||
45 | * @param Builder $query |
||
46 | * @param UserInterface $user |
||
47 | */ |
||
48 | public function scopeBelongingToUser(Builder $query, UserInterface $user) |
||
52 | |||
53 | /** |
||
54 | * Get the key. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | public function getKey() |
||
62 | |||
63 | /** |
||
64 | * Set the key. |
||
65 | * |
||
66 | * @param $key |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function setKey($key) |
||
75 | |||
76 | /** |
||
77 | * Get the user. |
||
78 | * |
||
79 | * @return UserInterface |
||
80 | */ |
||
81 | public function getUser() |
||
85 | |||
86 | /** |
||
87 | * Set the user. |
||
88 | * |
||
89 | * @param UserInterface $user |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setUser(UserInterface $user) |
||
98 | |||
99 | /** |
||
100 | * Get the value. |
||
101 | * |
||
102 | * @return mixed |
||
103 | */ |
||
104 | public function getValue() |
||
108 | |||
109 | /** |
||
110 | * Set the value. |
||
111 | * |
||
112 | * @param $value |
||
113 | * @return $this |
||
114 | */ |
||
115 | public function setValue($value) |
||
121 | |||
122 | /** |
||
123 | * Set the value. |
||
124 | * |
||
125 | * @param $value |
||
126 | * @return $this |
||
127 | */ |
||
128 | protected function setValueAttribute($value) |
||
134 | |||
135 | /** |
||
136 | * Get the value attribute. |
||
137 | * |
||
138 | * @return mixed |
||
139 | */ |
||
140 | protected function getValueAttribute() |
||
148 | |||
149 | /** |
||
150 | * Get the field type's presenter |
||
151 | * for a given field slug. |
||
152 | * |
||
153 | * We're overriding this to catch |
||
154 | * the "value" key. |
||
155 | * |
||
156 | * @param $fieldSlug |
||
157 | * @return FieldTypePresenter |
||
158 | */ |
||
159 | public function getFieldTypePresenter($fieldSlug) |
||
167 | } |
||
168 |