1515/**
1616 * Model for Accessories.
1717 *
18- * @version v1.0
18+ * @version v1.0
1919 */
2020class Accessory extends SnipeModel
2121{
@@ -56,8 +56,8 @@ class Accessory extends SnipeModel
5656 ];
5757
5858 /**
59- * Accessory validation rules
60- */
59+ * Accessory validation rules
60+ */
6161 public $ rules = [
6262 'name ' => 'required|min:3|max:255 ' ,
6363 'qty ' => 'required|integer|min:1 ' ,
@@ -71,12 +71,12 @@ class Accessory extends SnipeModel
7171
7272
7373 /**
74- * Whether the model should inject it's identifier to the unique
75- * validation rules before attempting validation. If this property
76- * is not set in the model it will default to true.
77- *
74+ * Whether the model should inject it's identifier to the unique
75+ * validation rules before attempting validation. If this property
76+ * is not set in the model it will default to true.
77+ *
7878 * @var bool
79- */
79+ */
8080 protected $ injectUniqueIdentifier = true ;
8181 use ValidatingTrait;
8282
@@ -108,7 +108,7 @@ class Accessory extends SnipeModel
108108 * Establishes the accessory -> supplier relationship
109109 *
110110 * @author [A. Gianotto] [<[email protected] >] 111- * @since [v3.0]
111+ * @since [v3.0]
112112 * @return \Illuminate\Database\Eloquent\Relations\Relation
113113 */
114114 public function supplier ()
@@ -121,7 +121,7 @@ public function supplier()
121121 * Sets the requestable attribute on the accessory
122122 *
123123 * @author [A. Gianotto] [<[email protected] >] 124- * @since [v4.0]
124+ * @since [v4.0]
125125 * @return void
126126 */
127127 public function setRequestableAttribute ($ value )
@@ -136,7 +136,7 @@ public function setRequestableAttribute($value)
136136 * Establishes the accessory -> company relationship
137137 *
138138 * @author [A. Gianotto] [<[email protected] >] 139- * @since [v3.0]
139+ * @since [v3.0]
140140 * @return \Illuminate\Database\Eloquent\Relations\Relation
141141 */
142142 public function company ()
@@ -148,7 +148,7 @@ public function company()
148148 * Establishes the accessory -> location relationship
149149 *
150150 * @author [A. Gianotto] [<[email protected] >] 151- * @since [v3.0]
151+ * @since [v3.0]
152152 * @return \Illuminate\Database\Eloquent\Relations\Relation
153153 */
154154 public function location ()
@@ -160,7 +160,7 @@ public function location()
160160 * Establishes the accessory -> category relationship
161161 *
162162 * @author [A. Gianotto] [<[email protected] >] 163- * @since [v3.0]
163+ * @since [v3.0]
164164 * @return \Illuminate\Database\Eloquent\Relations\Relation
165165 */
166166 public function category ()
@@ -172,7 +172,7 @@ public function category()
172172 * Returns the action logs associated with the accessory
173173 *
174174 * @author [A. Gianotto] [<[email protected] >] 175- * @since [v3.0]
175+ * @since [v3.0]
176176 * @return \Illuminate\Database\Eloquent\Relations\Relation
177177 */
178178 public function assetlog ()
@@ -201,8 +201,8 @@ public function assetlog()
201201 *
202202 * It's super-mega-assy, but it's the best I could do for now.
203203 *
204- * @author A. Gianotto <[email protected] > 205- * @since v5.0.0
204+ * @author A. Gianotto <[email protected] > 205+ * @since v5.0.0
206206 *
207207 * @see \App\Http\Controllers\Api\AccessoriesController\checkedout()
208208 */
@@ -219,7 +219,7 @@ public function lastCheckout()
219219 * presenter or service provider
220220 *
221221 * @author [A. Gianotto] [<[email protected] >] 222- * @since [v3.0]
222+ * @since [v3.0]
223223 * @return string
224224 */
225225 public function getImageUrl ()
@@ -235,7 +235,7 @@ public function getImageUrl()
235235 * Establishes the accessory -> users relationship
236236 *
237237 * @author [A. Gianotto] [<[email protected] >] 238- * @since [v3.0]
238+ * @since [v3.0]
239239 * @return \Illuminate\Database\Eloquent\Relations\Relation
240240 */
241241 public function checkouts ()
@@ -248,7 +248,7 @@ public function checkouts()
248248 * Establishes the accessory -> admin user relationship
249249 *
250250 * @author A. Gianotto <[email protected] > 251- * @since [v7.0.13]
251+ * @since [v7.0.13]
252252 * @return \Illuminate\Database\Eloquent\Relations\Relation
253253 */
254254 public function adminuser ()
@@ -260,7 +260,7 @@ public function adminuser()
260260 * Checks whether or not the accessory has users
261261 *
262262 * @author [A. Gianotto] [<[email protected] >] 263- * @since [v3.0]
263+ * @since [v3.0]
264264 * @return int
265265 */
266266 public function hasUsers ()
@@ -274,7 +274,7 @@ public function hasUsers()
274274 * Establishes the accessory -> manufacturer relationship
275275 *
276276 * @author [A. Gianotto] [<[email protected] >] 277- * @since [v3.0]
277+ * @since [v3.0]
278278 * @return \Illuminate\Database\Eloquent\Relations\Relation
279279 */
280280 public function manufacturer ()
@@ -287,7 +287,7 @@ public function manufacturer()
287287 * accessory based on the category it belongs to.
288288 *
289289 * @author [A. Gianotto] [<[email protected] >] 290- * @since [v3.0]
290+ * @since [v3.0]
291291 * @return bool
292292 */
293293 public function checkin_email ()
@@ -300,7 +300,7 @@ public function checkin_email()
300300 * accept it via email.
301301 *
302302 * @author [A. Gianotto] [<[email protected] >] 303- * @since [v3.0]
303+ * @since [v3.0]
304304 * @return bool
305305 */
306306 public function requireAcceptance ()
@@ -313,7 +313,7 @@ public function requireAcceptance()
313313 * checks for a settings level EULA
314314 *
315315 * @author [A. Gianotto] [<[email protected] >] 316- * @since [v3.0]
316+ * @since [v3.0]
317317 * @return string
318318 */
319319 public function getEula ()
@@ -333,7 +333,7 @@ public function getEula()
333333 * Check how many items within an accessory are checked out
334334 *
335335 * @author [A. Gianotto] [<[email protected] >] 336- * @since [v5.0]
336+ * @since [v5.0]
337337 * @return int
338338 */
339339 public function numCheckedOut ()
@@ -350,7 +350,7 @@ public function numCheckedOut()
350350 * bad things happen.
351351 *
352352 * @author [A. Gianotto] [<[email protected] >] 353- * @since [v3.0]
353+ * @since [v3.0]
354354 * @return int
355355 */
356356 public function numRemaining ()
@@ -365,8 +365,8 @@ public function numRemaining()
365365 /**
366366 * Run after the checkout acceptance was declined by the user
367367 *
368- * @param User $acceptedBy
369- * @param string $signature
368+ * @param User $acceptedBy
369+ * @param string $signature
370370 */
371371 public function declinedCheckout (User $ declinedBy , $ signature )
372372 {
@@ -392,8 +392,8 @@ public function declinedCheckout(User $declinedBy, $signature)
392392 * This simply checks that there is a value for quantity, and if there isn't, set it to 0.
393393 *
394394 * @author A. Gianotto <[email protected] > 395- * @since v6.3.4
396- * @param $value
395+ * @since v6.3.4
396+ * @param $value
397397 * @return void
398398 */
399399 public function setQtyAttribute ($ value )
@@ -410,76 +410,75 @@ public function setQtyAttribute($value)
410410
411411 /**
412412 * Query builder scope to order on created_by name
413- *
414413 */
415414 public function scopeOrderByCreatedByName ($ query , $ order )
416415 {
417416 return $ query ->leftJoin ('users as admin_sort ' , 'accessories.created_by ' , '= ' , 'admin_sort.id ' )->select ('accessories.* ' )->orderBy ('admin_sort.first_name ' , $ order )->orderBy ('admin_sort.last_name ' , $ order );
418417 }
419418
420419 /**
421- * Query builder scope to order on company
422- *
423- * @param \Illuminate\Database\Query\Builder $query Query builder instance
424- * @param text $order Order
425- *
426- * @return \Illuminate\Database\Query\Builder Modified query builder
427- */
420+ * Query builder scope to order on company
421+ *
422+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
423+ * @param text $order Order
424+ *
425+ * @return \Illuminate\Database\Query\Builder Modified query builder
426+ */
428427 public function scopeOrderCompany ($ query , $ order )
429428 {
430429 return $ query ->leftJoin ('companies ' , 'accessories.company_id ' , '= ' , 'companies.id ' )
431- ->orderBy ('companies.name ' , $ order );
430+ ->orderBy ('companies.name ' , $ order );
432431 }
433432
434433 /**
435- * Query builder scope to order on category
436- *
437- * @param \Illuminate\Database\Query\Builder $query Query builder instance
438- * @param text $order Order
439- *
440- * @return \Illuminate\Database\Query\Builder Modified query builder
441- */
434+ * Query builder scope to order on category
435+ *
436+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
437+ * @param text $order Order
438+ *
439+ * @return \Illuminate\Database\Query\Builder Modified query builder
440+ */
442441 public function scopeOrderCategory ($ query , $ order )
443442 {
444443 return $ query ->leftJoin ('categories ' , 'accessories.category_id ' , '= ' , 'categories.id ' )
445- ->orderBy ('categories.name ' , $ order );
444+ ->orderBy ('categories.name ' , $ order );
446445 }
447446
448447 /**
449- * Query builder scope to order on location
450- *
451- * @param \Illuminate\Database\Query\Builder $query Query builder instance
452- * @param text $order Order
453- *
454- * @return \Illuminate\Database\Query\Builder Modified query builder
455- */
448+ * Query builder scope to order on location
449+ *
450+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
451+ * @param text $order Order
452+ *
453+ * @return \Illuminate\Database\Query\Builder Modified query builder
454+ */
456455 public function scopeOrderLocation ($ query , $ order )
457456 {
458457 return $ query ->leftJoin ('locations ' , 'accessories.location_id ' , '= ' , 'locations.id ' )
459- ->orderBy ('locations.name ' , $ order );
458+ ->orderBy ('locations.name ' , $ order );
460459 }
461460
462461 /**
463- * Query builder scope to order on manufacturer
464- *
465- * @param \Illuminate\Database\Query\Builder $query Query builder instance
466- * @param text $order Order
467- *
468- * @return \Illuminate\Database\Query\Builder Modified query builder
469- */
462+ * Query builder scope to order on manufacturer
463+ *
464+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
465+ * @param text $order Order
466+ *
467+ * @return \Illuminate\Database\Query\Builder Modified query builder
468+ */
470469 public function scopeOrderManufacturer ($ query , $ order )
471470 {
472471 return $ query ->leftJoin ('manufacturers ' , 'accessories.manufacturer_id ' , '= ' , 'manufacturers.id ' )->orderBy ('manufacturers.name ' , $ order );
473472 }
474473
475474 /**
476- * Query builder scope to order on supplier
477- *
478- * @param \Illuminate\Database\Query\Builder $query Query builder instance
479- * @param text $order Order
480- *
481- * @return \Illuminate\Database\Query\Builder Modified query builder
482- */
475+ * Query builder scope to order on supplier
476+ *
477+ * @param \Illuminate\Database\Query\Builder $query Query builder instance
478+ * @param text $order Order
479+ *
480+ * @return \Illuminate\Database\Query\Builder Modified query builder
481+ */
483482 public function scopeOrderSupplier ($ query , $ order )
484483 {
485484 return $ query ->leftJoin ('suppliers ' , 'accessories.supplier_id ' , '= ' , 'suppliers.id ' )->orderBy ('suppliers.name ' , $ order );
0 commit comments