$product->
fromArray($params);
$violations =
$this->
getManager()->
validate($product);
if ($violations->
count() > 0
) { throw new ValidationException($violations);
} $this->
getManager()->
persist($product);
$this->
flush();
if (!
empty($translations)) { $this->
writeTranslations($product->
getId(),
$translations);
} return $product;
} /**
* Convenience method to update a product by number
*
* @param string $number
*
* @throws ValidationException
* @throws NotFoundException
* @throws ParameterMissingException
*
* @return ProductModel
*/