if (!
$this->
isValidStock($product,
$newStock)) { $invalid[] =
$product;
} } return $invalid;
} private function getOrderPositionByProduct(ProductVariant
$variant, Order
$order): ?Detail
{ foreach ($order->
getDetails() as $detail) { if (!
$this->
isProductPosition($detail)) { continue;
} if ($detail->
getArticleNumber() ===
$variant->
getNumber()) { return $detail;
} } return null;
} /**
* @return ProductVariant[]
*/