/**
* Constructor.
*
* @param string $name
* @param array|object $data
* @param ValidatorInterface $validator
* @param array $options
*/
public function __construct($name, $data, ValidatorInterface $validator, array $options = array())
{
$this->validator = $validator;
$this->setData($data);
if (FormConfiguration::isDefaultCsrfProtectionEnabled()) {
$this->enableCsrfProtection();
}
if (FormConfiguration::getDefaultLocale() !== null) {
$this->setLocale(FormConfiguration::getDefaultLocale());
}
parent::__construct($name, $options);
}