/** * Constructor * @param $name * @param array $constraints * @param callable $handler * @param mixed $defaultValue Default value if field is empty */ public function __construct($name, array $constraints, callable $handler, $defaultValue = '') { parent::__construct($name, $constraints, $defaultValue); $this->handler = $handler; }
/** * @inheritDoc * @param int $fieldIndex Position of this field in an iteration of input data */ public function __construct($name, array $constraints, $fieldIndex, $defaultValue = '') { parent::__construct($name, $constraints, $defaultValue); $this->fieldIndex = $fieldIndex; $this->propertyAccessor = PropertyAccess::createPropertyAccessor(); }