setName('form_config_authbackend_db'); } /** * Set the resource names the user can choose from * * @param array $resources The resources to choose from * * @return $this */ public function setResources(array $resources) { $this->resources = $resources; return $this; } /** * Create and add elements to this form * * @param array $formData */ public function createElements(array $formData) { $this->addElement( 'text', 'name', array( 'required' => true, 'label' => $this->translate('Backend Name'), 'description' => $this->translate( 'The name of this authentication provider that is used to differentiate it from others' ) ) ); $this->addElement( 'select', 'resource', array( 'required' => true, 'label' => $this->translate('Database Connection'), 'description' => $this->translate( 'The database connection to use for authenticating with this provider' ), 'multiOptions' => !empty($this->resources) ? array_combine($this->resources, $this->resources) : array() ) ); $this->addElement( 'hidden', 'backend', array( 'disabled' => true, 'value' => 'db' ) ); } }