// Sort all line items by their price definition priority
krsort($lineItemsByPricePriority);
if (\
count($lineItemsByPricePriority)) { $this->elements =
array_merge(...
$lineItemsByPricePriority);
} } public function filterGoods(): self
{ return $this->
filter( fn (LineItem
$lineItem) =>
$lineItem->
isGood() );
} /**
* @return LineItem[]
*/
public function filterGoodsFlat(): array
{ $lineItems =
$this->
getFlat();
$filtered =
[];