public function getIdFromNumber($number) { if (empty($number)) { throw new ParameterMissingException('id'
);
} $productVariant =
$this->
getDetailRepository()->
findOneBy(['number' =>
$number]);
if (!
$productVariant instanceof Detail
) { throw new NotFoundException(sprintf('Product by number "%s" not found',
$number));
} return $productVariant->
getArticle()->
getId();
} /**
* Convenience method to get a product by number
*
* @param string $number
*
* @return array|ProductModel
*/