$first =
$data[0
];
$group->
setId((int) $first['__priceGroup_id'
]);
$group->
setName($first['__priceGroup_description'
]);
$discounts =
[];
foreach ($data as $row) { $discounts[] =
$this->
hydratePriceDiscount($row);
} $group->
setDiscounts($discounts);
return $group;
} /**
* @return PriceDiscount
*/
public function hydratePriceDiscount(array
$data) { $discount =
new PriceDiscount();
$discount->
setId((int) $data['__priceGroupDiscount_id'
]);