1 | <?php |
||
11 | trait ManagesPortfolio |
||
12 | { |
||
13 | use ManagesPages, ManagesProjects; |
||
14 | |||
15 | /** |
||
16 | * Add a blocks and links to model. |
||
17 | * |
||
18 | * @param HasContent $model Model to add extras to. |
||
19 | * @param array $data Array of posted user data. |
||
20 | * |
||
21 | * @return HasContent |
||
22 | */ |
||
23 | protected function addModelExtras(HasContent $model, array $data) |
||
35 | |||
36 | /** |
||
37 | * Update a HasContent model and its children. |
||
38 | * |
||
39 | * @param HasContent $model Model to update. |
||
40 | * @param array $data Array of posted user data. |
||
41 | * |
||
42 | * @return HasContent |
||
43 | */ |
||
44 | protected function updateModel(HasContent $model, array $data) |
||
54 | |||
55 | /** |
||
56 | * Permanently delete a model. |
||
57 | * |
||
58 | * @param HasContent $model Model to delete. |
||
59 | * |
||
60 | * @return boolean |
||
61 | */ |
||
62 | protected function purgeModel(HasContent $model) |
||
72 | |||
73 | /** |
||
74 | * Set order of data based on order value. |
||
75 | * |
||
76 | * @param array $data Data array containing 'order' index. |
||
77 | * |
||
78 | * @return \Illuminate\Support\Collection |
||
79 | */ |
||
80 | protected function setOrder(array $data) |
||
89 | |||
90 | /** |
||
91 | * Add a text block to a model. |
||
92 | * |
||
93 | * @param HasContent $model Model to add text block to. |
||
94 | * @param array $blockData Array of text block data. |
||
95 | * |
||
96 | * @return HasContent |
||
97 | */ |
||
98 | public function addBlockToModel(HasContent $model, array $blockData) |
||
102 | |||
103 | /** |
||
104 | * Update a text block. |
||
105 | * |
||
106 | * @param TextBlock $textBlock Text block to update. |
||
107 | * @param array $blockData Array of text block data. |
||
108 | * |
||
109 | * @return TextBlock |
||
110 | */ |
||
111 | public function updateTextBlock(TextBlock $textBlock, array $blockData) |
||
117 | |||
118 | /** |
||
119 | * Update model text blocks by adding new ones and updating existing ones. |
||
120 | * |
||
121 | * @param Model $model Model that blocks belong to. |
||
122 | * @param array $data Array of model information. |
||
123 | */ |
||
124 | public function updateAllTextBlocks(Model $model, array $data) |
||
138 | |||
139 | /** |
||
140 | * Remove a text block from a model. |
||
141 | * |
||
142 | * @param TextBlock $textBlock The text block to delete. |
||
143 | * |
||
144 | * @return bool|null |
||
145 | */ |
||
146 | public function removeTextBlock(TextBlock $textBlock) |
||
150 | |||
151 | /** |
||
152 | * Add image to a model. |
||
153 | * |
||
154 | * @param HasContent $model Model to add image to. |
||
155 | * @param array $imageData Array of image infomation. |
||
156 | * |
||
157 | * @return HasContent |
||
158 | */ |
||
159 | public function addImageToModel(HasContent $model, array $imageData) |
||
163 | |||
164 | /** |
||
165 | * Update image name and caption. |
||
166 | * |
||
167 | * @param Image $image Image to update. |
||
168 | * @param array $imageData Array of inmage information. |
||
169 | * |
||
170 | * @return Image |
||
171 | */ |
||
172 | public function updateImageInfo(Image $image, array $imageData) |
||
178 | |||
179 | /** |
||
180 | * Remove image from storage and delete database info. |
||
181 | * |
||
182 | * @param Image $image Image to remove. |
||
183 | * |
||
184 | * @return bool|null |
||
185 | */ |
||
186 | public function removeImage(Image $image) |
||
192 | |||
193 | /** |
||
194 | * Add a link to a model. |
||
195 | * |
||
196 | * @param HasContent $model Model to add link to. |
||
197 | * @param array $linkData Array of link info. |
||
198 | */ |
||
199 | public function addLinkToModel(HasContent $model, array $linkData) |
||
203 | |||
204 | /** |
||
205 | * Update a link. |
||
206 | * |
||
207 | * @param Link $link Link to update. |
||
208 | * @param array $linkData Array of link data. |
||
209 | * |
||
210 | * @return Link |
||
211 | */ |
||
212 | public function updateLink(Link $link, array $linkData) |
||
218 | |||
219 | /** |
||
220 | * Update model links by adding new ones and updating existing ones. |
||
221 | * |
||
222 | * @param Model $model Model that links belong to. |
||
223 | * @param array $data Array of model information. |
||
224 | */ |
||
225 | public function updateAllLinks(Model $model, array $data) |
||
239 | |||
240 | /** |
||
241 | * Remove link from a model. |
||
242 | * |
||
243 | * @param Link $link Link to remove. |
||
244 | * |
||
245 | * @return bool|null |
||
246 | */ |
||
247 | public function removeLink(Link $link) |
||
251 | |||
252 | /** |
||
253 | * Update content associated with model. |
||
254 | * |
||
255 | * @param HasContent $model Model associated with content. |
||
256 | * @param string $type Type of model. |
||
257 | * @param array $data user posted data. |
||
258 | * @param callable $updateCallback Callback to update the content. |
||
259 | * @param callable $addCallback Callback to add new content. |
||
260 | */ |
||
261 | protected function updateContent( |
||
280 | } |
||
281 |
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.