/** * Sets a given array of data onto a given format-options entity. * * @param FormatOptions $formatOptions * @param array $data * * @throws FormatOptionsMissingParameterException * * @return FormatOptions The format-options entity with set data */ private function setDataOnEntity(FormatOptions $formatOptions, array $data) { if (!isset($data['cropX']) || !isset($data['cropY']) || !isset($data['cropWidth']) || !isset($data['cropHeight'])) { throw new FormatOptionsMissingParameterException(); } $formatOptions->setCropX($data['cropX']); $formatOptions->setCropY($data['cropY']); $formatOptions->setCropWidth($data['cropWidth']); $formatOptions->setCropHeight($data['cropHeight']); return $formatOptions; }