protected function validator($input)
    {
        $this->checkValue($input);

        if ($this->hasErrors()) {
            return '';
        }

        if (!$input) {
            if ($this->mandatory) {
                $this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['mandatory'], $this->strLabel));
            }

            return '';
        } elseif (false === strpos($input, ',')) {
            return $this->multiple ? [(int) $input] : (int) $input;
        }
        $arrValue = array_map('intval', array_filter(explode(',', $input)));

        return $this->multiple ? $arrValue : $arrValue[0];
    }
protected function validator($input)
    {
        $this->checkValue($input);

        if ($this->hasErrors()) {
            return '';
        }

        if (!$input) {
            if ($this->mandatory) {
                $this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['mandatory'], $this->strLabel));
            }

            return '';
        } elseif (false === strpos($input, ',')) {
            return $this->multiple ? [(int) $input] : (int) $input;
        }
        $arrValue = array_map('intval', array_filter(explode(',', $input)));

        return $this->multiple ? $arrValue : $arrValue[0];
    }
protected function validator ( $ input ) { $ this -> checkValue ( $ input ) ; if ( $ this -> hasErrors ( ) ) { return '' ; } if ( ! $ input ) { if ( $ this -> mandatory ) { $ this -> addError ( sprintf ( $ GLOBALS [ 'TL_LANG' ] [ 'ERR' ] [ 'mandatory' ] , $ this -> strLabel ) ) ; } return '' ; } elseif ( false === strpos ( $ input , ',' ) ) { return $ this -> multiple ? [ ( int ) $ input ] : ( int ) $ input ; } $ arrValue = array_map ( 'intval' , array_filter ( explode ( ',' , $ input ) ) ) ; return $ this -> multiple ? $ arrValue : $ arrValue [ 0 ] ; }
Return an array if the "multiple" attribute is set.

@param mixed $input

@return mixed
Return an array if the multiple attribute is set .