public function getValueOptions() { if ($this->initialized) { return parent::getValueOptions(); } $this->initialized = true; $valueOptions = []; foreach ($this->clientRepository->findAllActive() as $client) { $valueOptions[$client->getId()] = $client->getName(); } $this->setValueOptions($valueOptions); $this->insertSelectedClientIfRequired($this->value); return parent::getValueOptions(); }
public function indexAction() { return new ViewModel(['clients' => $this->clientRepository->findAllActive()]); }