unset($params['discounts'
]);
$result->
fromArray($params);
$violations =
$this->
getManager()->
validate($result);
if ($violations->
count() > 0
) { throw new ValidationException($violations);
} $this->
getManager()->
persist($result);
$this->
saveDiscounts($discounts,
$result);
$this->
flush();
return $result;
} /**
* @param int $id
*
* @throws ValidationException
* @throws NotFoundException
* @throws ParameterMissingException
*
* @return Group
*/