$prices =
$builder->
select(['prices', 'attribute', 'customerGroup'
]) ->
from(Price::
class, 'prices'
) ->
innerJoin('prices.customerGroup', 'customerGroup'
) ->
leftJoin('prices.attribute', 'attribute'
) ->
where('prices.articleDetailsId = ?1'
) ->
setParameter(1,
$mainDetail->
getId()) ->
getQuery() ->
getArrayResult();
foreach ($prices as $key =>
$price) { unset($price['id'
]);
$price['customerGroup'
] =
$this->
getCustomerGroupRepository()->
find($price['customerGroup'
]['id'
]);
$price['article'
] =
$mainDetail->
getArticle();
$prices[$key] =
$price;
} $mainData['prices'
] =
$prices;
} if ($mapping['basePrice'
]) { $mainData['unit'
] =
$mainDetail->
getUnit();
$mainData['purchaseUnit'
] =
$mainDetail->
getPurchaseUnit();
$mainData['referenceUnit'
] =
$mainDetail->
getReferenceUnit();
$mainData['packUnit'
] =
$mainDetail->
getPackUnit();
}