mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 06:47:46 -08:00
Check to see if model relationship exists before using it
This commit is contained in:
parent
49b50d81ee
commit
ab51857854
|
@ -38,7 +38,7 @@ class AssetsTransformer
|
||||||
'byod' => ($asset->byod ? true : false),
|
'byod' => ($asset->byod ? true : false),
|
||||||
|
|
||||||
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
|
'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null,
|
||||||
'eol' => ($asset->model->eol != '') ? $asset->model->eol : null,
|
'eol' => (($asset->model) && ($asset->model->eol != '')) ? $asset->model->eol : null,
|
||||||
'asset_eol_date' => ($asset->asset_eol_date != '') ? Helper::getFormattedDateObject($asset->asset_eol_date, 'date') : null,
|
'asset_eol_date' => ($asset->asset_eol_date != '') ? Helper::getFormattedDateObject($asset->asset_eol_date, 'date') : null,
|
||||||
'status_label' => ($asset->assetstatus) ? [
|
'status_label' => ($asset->assetstatus) ? [
|
||||||
'id' => (int) $asset->assetstatus->id,
|
'id' => (int) $asset->assetstatus->id,
|
||||||
|
|
Loading…
Reference in a new issue