public function addValidator(ValidatorInterface $validator)
    {
        $formDefinition = $this->getRootForm();
        $formDefinition->getProcessingRule($this->getIdentifier())->addValidator($validator);
    }
public function addValidator(ValidatorInterface $validator)
    {
        $formDefinition = $this->getRootForm();
        $formDefinition->getProcessingRule($this->getIdentifier())->addValidator($validator);
    }
public function addValidator ( ValidatorInterface $ validator ) { $ formDefinition = $ this -> getRootForm ( ) ; $ formDefinition -> getProcessingRule ( $ this -> getIdentifier ( ) ) -> addValidator ( $ validator ) ; }
Add a validator to the element

@param ValidatorInterface $validator
@return void
Add a validator to the element