getQueryParams()[self::SOURCE_ID] ?? null; $classId = $request->getQueryParams()[self::CLASS_ID] ?? null; if ($sourceId === null && $classId === null) { throw new InvalidArgumentException('Parameter sourceId or classId must be provided'); } return new FindAllQuery($sourceId, $classId); } private function getMediaRelationRepository(): MediaRelationRepositoryInterface { return $this->getServiceLocator()->get(MediaRelationRepositoryInterface::SERVICE_ID); } }