pageRenderer = $pageRenderer; $this->listingPageLimit = $listingPageLimit; $this->dateBlock = $dateBlock; $this->segmentsListRepository = $segmentsListRepository; $this->customFieldsRepository = $customFieldsRepository; $this->customFieldsResponseBuilder = $customFieldsResponseBuilder; } public function render() { $data = []; $data['items_per_page'] = $this->listingPageLimit->getLimitPerPage('subscribers'); $data['segments'] = $this->segmentsListRepository->getListWithSubscribedSubscribersCounts(); $data['custom_fields'] = array_map(function(CustomFieldEntity $customField): array { $field = $this->customFieldsResponseBuilder->build($customField); if (!empty($field['params']['values'])) { $values = []; foreach ($field['params']['values'] as $value) { $values[$value['value']] = $value['value']; } $field['params']['values'] = $values; } return $field; }, $this->customFieldsRepository->findAll()); $data['date_formats'] = $this->dateBlock->getDateFormats(); $data['month_names'] = $this->dateBlock->getMonthNames(); $data['max_confirmation_emails'] = ConfirmationEmailMailer::MAX_CONFIRMATION_EMAILS; $this->pageRenderer->displayPage('subscribers/subscribers.html', $data); } }