Added location to checkout method

This commit is contained in:
snipe 2017-11-03 19:39:48 -07:00
parent 1c12b6e13b
commit b786791401

View file

@ -144,7 +144,7 @@ class Asset extends Depreciable
* @return bool
*/
//FIXME: The admin parameter is never used. Can probably be removed.
public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null)
public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null, $location = null)
{
if (!$target) {
return false;
@ -163,6 +163,10 @@ class Asset extends Depreciable
$this->name = $name;
}
if ($location != null) {
$this->location_id = $location;
}
if ($this->requireAcceptance()) {
if(get_class($target) != User::class) {
throw new CheckoutNotAllowed;