protected function setRules($ruleAr)
    {
        v::with('Amcms\\Services\\ValidatorRules\\');
        $vObj = v::initValidator();

        if (!is_array($ruleAr)) {
            return $vObj;
        }

        foreach ($ruleAr as $ruleStr) {
            $data = explode(':', trim($ruleStr));
            switch ($data[0]) {
                case 'required':
                    $vObj->notEmpty();
                    break;

                case 'email':
                    $vObj->email();
                    break;

                default:
                    break;
            }
        }

        return $vObj;
    }
protected function setRules($ruleAr)
    {
        v::with('Amcms\\Services\\ValidatorRules\\');
        $vObj = v::initValidator();

        if (!is_array($ruleAr)) {
            return $vObj;
        }

        foreach ($ruleAr as $ruleStr) {
            $data = explode(':', trim($ruleStr));
            switch ($data[0]) {
                case 'required':
                    $vObj->notEmpty();
                    break;

                case 'email':
                    $vObj->email();
                    break;

                default:
                    break;
            }
        }

        return $vObj;
    }
protected function setRules ( $ ruleAr ) { v :: with ( 'Amcms\\Services\\ValidatorRules\\' ) ; $ vObj = v :: initValidator ( ) ; if ( ! is_array ( $ ruleAr ) ) { return $ vObj ; } foreach ( $ ruleAr as $ ruleStr ) { $ data = explode ( ':' , trim ( $ ruleStr ) ) ; switch ( $ data [ 0 ] ) { case 'required' : $ vObj -> notEmpty ( ) ; break ; case 'email' : $ vObj -> email ( ) ; break ; default : break ; } } return $ vObj ; }
Create rules chain
@param array $ruleAr string-based rules
@return  Respect\Validation\Validator
Create rules chain