$variant =
$this->
getRepository()->
find($id);
if (!
$variant instanceof Detail
) { throw new NotFoundException(sprintf('Variant by id %d not found',
$id));
} $variant =
$this->
internalUpdate($id,
$params,
$variant->
getArticle());
$violations =
$this->
getManager()->
validate($variant);
if ($violations->
count() > 0
) { throw new ValidationException($violations);
} $this->
flush();
return $variant;
} /**
* Creates a new variant for an product.
* This function requires an articleId in the params parameter.
*
* @throws ValidationException
* @throws NotFoundException
* @throws ParameterMissingException
*
* @return Detail
*/