class FunctionService {

	@Transactional
	public List<Function> update(List<Function> functions, BindingResult errors, RequestInfo requestInfo) {

		try {

			functions = fetchRelated(functions);

			validate(functions, Constants.ACTION_UPDATE, errors);

			if (errors.hasErrors()) {
				throw new CustomBindException(errors);
			}
			for (Function b : functions) {
				b.update();
			}

		} catch (CustomBindException e) {

			throw new CustomBindException(errors);
		}

		return functionRepository.update(functions, requestInfo);

	}

}