Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (48 sloc) 1.37 KB
<?php
namespace ZfcUser\Form;
use ZfcUser\Options\RegistrationOptionsInterface;
class Register extends Base
{
/**
* @var RegistrationOptionsInterface
*/
protected $registrationOptions;
/**
* @param string|null $name
* @param RegistrationOptionsInterface $options
*/
public function __construct($name, RegistrationOptionsInterface $options)
{
$this->setRegistrationOptions($options);
parent::__construct($name);
$this->remove('userId');
if (!$this->getRegistrationOptions()->getEnableUsername()) {
$this->remove('username');
}
if (!$this->getRegistrationOptions()->getEnableDisplayName()) {
$this->remove('display_name');
}
$this->get('submit')->setLabel('Register');
$this->getEventManager()->trigger('init', $this);
}
/**
* Set Registration Options
*
* @param RegistrationOptionsInterface $registrationOptions
* @return Register
*/
public function setRegistrationOptions(RegistrationOptionsInterface $registrationOptions)
{
$this->registrationOptions = $registrationOptions;
return $this;
}
/**
* Get Registration Options
*
* @return RegistrationOptionsInterface
*/
public function getRegistrationOptions()
{
return $this->registrationOptions;
}
}
Jump to Line
Something went wrong with that request. Please try again.