Merge branch '537-add-container-size-to-battery-information' into 'master'
Resolve "Add container size to battery information" Closes #537 See merge request jankstudio/resq!628
This commit is contained in:
commit
9f44148e1a
1 changed files with 10 additions and 0 deletions
|
|
@ -33,10 +33,20 @@ class BatteryController extends APIController
|
|||
$result = [];
|
||||
foreach ($batteries as $batt)
|
||||
{
|
||||
$csize_id = '';
|
||||
$csize_name = '';
|
||||
if ($batt->getContainerSize() != null)
|
||||
{
|
||||
$csize_id = $batt->getContainerSize()->getID();
|
||||
$csize_name = $batt->getContainerSize()->getName();
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'id' => $batt->getID(),
|
||||
'size' => $batt->getSize()->getID(),
|
||||
'brand' => $batt->getBrand()->getID(),
|
||||
'container_size_id' => $csize_id,
|
||||
'container_size_name' => $csize_name,
|
||||
'date_update' => $batt->getDateUpdate()->format('YmdHis'),
|
||||
'flag_new' => $batt->isNew(),
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in a new issue