Switched defaultLoc to belongsTo relationship

This commit is contained in:
snipe
2015-07-02 16:51:52 -07:00
parent 1d4cfcfd58
commit 552bdfdc2d
+7 -7
View File
@@ -58,11 +58,11 @@ class Asset extends Depreciable
/**
* Get the asset's location based on the assigned user
* Get the asset's location based on default RTD location
**/
public function defaultLoc()
{
return $this->hasOne('Location', 'id', 'rtd_location_id');
return $this->belongsTo('Location', 'rtd_location_id');
}
@@ -119,9 +119,9 @@ class Asset extends Depreciable
{
return $this->belongsTo('Statuslabel','status_id');
}
/**
* Get name for EULA
/**
* Get name for EULA
**/
public function showAssetName()
{
@@ -131,7 +131,7 @@ class Asset extends Depreciable
return $this->name;
}
}
public function warrantee_expires()
{
$date = date_create($this->purchase_date);
@@ -175,7 +175,7 @@ class Asset extends Depreciable
{
return $this->belongsTo('Supplier','supplier_id');
}
public function months_until_eol()
{