public function getRule()
    {
        $rules = [];
        if ($this->isRequired()) {
            $rules[] = 'required';
        }
        if ($this->getValidations()) {
            $rules[] = $this->getValidations();
        }

        $rules = join('|', $rules);
        return $rules;
    }
public function getRule()
    {
        $rules = [];
        if ($this->isRequired()) {
            $rules[] = 'required';
        }
        if ($this->getValidations()) {
            $rules[] = $this->getValidations();
        }

        $rules = join('|', $rules);
        return $rules;
    }
public function getRule ( ) { $ rules = [ ] ; if ( $ this -> isRequired ( ) ) { $ rules [ ] = 'required' ; } if ( $ this -> getValidations ( ) ) { $ rules [ ] = $ this -> getValidations ( ) ; } $ rules = join ( '|' , $ rules ) ; return $ rules ; }
Generate validation rule for this field.
@return array|string
Generate validation rule for this field .