Compact the method just a little

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2025-02-22 19:02:41 +00:00
parent 19fb45f488
commit 9abf3029ef

View file

@ -413,15 +413,12 @@ class Asset extends Depreciable
return $this->rules;
}
public function customFieldsForCheckinCheckout($type) {
public function customFieldsForCheckinCheckout($checkin_checkout) {
// Check to see if any of the custom fields were included on the form and if they have any values
if (($this->model) && ($this->model->fieldset) && ($this->model->fieldset->fields)) {
foreach ($this->model->fieldset->fields as $field) {
if ($field->{$type} == 1) {
if (request()->has($field->db_column)) {
$this->{$field->db_column} = request()->get($field->db_column);
}
if (($field->{$checkin_checkout} == 1) && (request()->has($field->db_column))){
$this->{$field->db_column} = request()->get($field->db_column);
}
}
}