tfa = $tfa; } /** * Options getter * * @return array */ public function toOptionArray() { $providers = $this->tfa->getAllProviders(); $res = []; foreach ($providers as $provider) { $res[] = [ 'value' => $provider->getCode(), 'label' => $provider->getName(), ]; } return $res; } /** * Get options in "key-value" format * * @return array */ public function toArray() { $options = $this->toOptionArray(); $return = []; foreach ($options as $option) { $return[$option['value']] = $option['label']; } return $return; } }