seasonRepository->findBy([ 'active' => true ], limit: 10, offset: ($page * self::PAGE_SIZE) - self::PAGE_SIZE ); $seasonArray = []; if (!is_null($seasonCollection)) { foreach ($seasonCollection as $seasonObj) { $seasonDto = new SeasonDto(); $seasonDto->fillFromEntity($seasonObj); $seasonArray[] = $seasonDto->createSeasonArray(); } } return new JsonResponse( data: [ 'success' => true, 'seasons' => $seasonArray ], status: Response::HTTP_OK ); } }