From f1b2ba5c513fdff47700558dc0f81633b3a97489 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 13 Jan 2016 03:56:05 -0800 Subject: [PATCH] Additional comments --- app/models/User.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/models/User.php b/app/models/User.php index 911023311e..1f9a79f001 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -50,21 +50,33 @@ class User extends SentryUserModel return "//gravatar.com/avatar/{$gravatar}"; } + /** + * Get assets assigned to this user + */ public function assets() { return $this->hasMany('Asset', 'assigned_to')->withTrashed(); } + /** + * Get accessories assigned to this user + */ public function accessories() { return $this->belongsToMany('Accessory', 'accessories_users', 'assigned_to','accessory_id')->withPivot('id')->withTrashed(); } + /** + * Get consumables assigned to this user + */ public function consumables() { return $this->belongsToMany('Consumable', 'consumables_users', 'assigned_to','consumable_id')->withPivot('id')->withTrashed(); } + /** + * Get licenses assigned to this user + */ public function licenses() { return $this->belongsToMany('License', 'license_seats', 'assigned_to', 'license_id')->withPivot('id');