More refactoring

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2023-11-28 13:32:47 +00:00
parent f9d5c451bc
commit 4723cfd4ba
3 changed files with 143 additions and 62 deletions
+27 -2
View File
@@ -266,7 +266,7 @@ class Asset extends Depreciable
/**
* Determines if an asset is available for checkout.
* This checks to see if the it's checked out to an invalid (deleted) user
* This checks to see if it's checked out to an invalid (deleted) user
* OR if the assigned_to and deleted_at fields on the asset are empty AND
* that the status is deployable
*
@@ -292,6 +292,31 @@ class Asset extends Depreciable
}
/**
* Determines if an asset is available for checkout.
* This checks to see if it's checked out to an invalid (deleted) user
* OR if the assigned_to and deleted_at fields on the asset are empty AND
* that the status is deployable
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v3.0]
* @return bool
*/
public function isDeployableMeta()
{
// The asset status is not archived and is deployable
if (($this->assetstatus) && ($this->assetstatus->archived == '0') && (! $this->deleted_at)
&& ($this->assetstatus->deployable == '1'))
{
return true;
}
return false;
}
/**
* Checks the asset out to the target
*
@@ -753,7 +778,7 @@ class Asset extends Depreciable
}
/**
* Establishes the asset -> status relationship
* Establishes the asset -> license seats relationship
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0]