/**
* @throws ValidationException
* @throws Exception
*
* @return Group
*/
public function create(array
$params) { $this->
checkPrivilege('create'
);
$params =
$this->
prepareCustomerGroupData($params);
$result =
new Group();
$discounts =
$params['discounts'
];
unset($params['discounts'
]);
$result->
fromArray($params);
$violations =
$this->
getManager()->
validate($result);
if ($violations->
count() > 0
) { throw new ValidationException($violations);
}