src/Contao/View/Contao2BackendView/TreePicker.php
protected function validator($value)
    {
        $convertValue = $this->widgetToValue($value);

        if ((null === $convertValue) && $this->mandatory) {
            $translator = $this->getEnvironment()->getTranslator();

            $message = empty($this->label)
                ? $translator->translate('ERR.mdtryNoLabel')
                : \sprintf(
                    $translator->translate('ERR.mandatory'),
                    $this->strLabel
                );

            $this->addError($message);
        }

        return $convertValue;
    }
protected function validator($value)
    {
        $convertValue = $this->widgetToValue($value);

        if ((null === $convertValue) && $this->mandatory) {
            $translator = $this->getEnvironment()->getTranslator();

            $message = empty($this->label)
                ? $translator->translate('ERR.mdtryNoLabel')
                : \sprintf(
                    $translator->translate('ERR.mandatory'),
                    $this->strLabel
                );

            $this->addError($message);
        }

        return $convertValue;
    }
protected function validator ( $ value ) { $ convertValue = $ this -> widgetToValue ( $ value ) ; if ( ( null === $ convertValue ) && $ this -> mandatory ) { $ translator = $ this -> getEnvironment ( ) -> getTranslator ( ) ; $ message = empty ( $ this -> label ) ? $ translator -> translate ( 'ERR.mdtryNoLabel' ) : \ sprintf ( $ translator -> translate ( 'ERR.mandatory' ) , $ this -> strLabel ) ; $ this -> addError ( $ message ) ; } return $ convertValue ; }
Skip the field if "change selection" is not checked.

@param array $value The current value.

@return array|string
Skip the field if change selection is not checked .