private function posGroupTypeHandle(Position $p) { if ($p === null) { throw new Exceptions\NullPointerException("Argument Position was null"); } try { $group = null; $id = $this->getMixId($p->getGroup()); if ($id !== null) { $group = $this->sportGroupService->getSportGroup($id, false); } $p->setGroup($group); } catch (\Exception $e) { $this->logError($e); throw new Exceptions\DataErrorException($e->getMessage(), $e->getCode(), $e->getPrevious()); } return $p; }