public function setRules($fieldNameOrArray, $rules = [])
    {
        // Determine Parameter Mode:
        
        if (is_array($fieldNameOrArray)) {
            
            // Define All Rules:
            
            foreach ($fieldNameOrArray as $fieldName => $rules) {
                $this->setRules($fieldName, $rules);
            }
            
        } else {
            
            // Define Rules for Specified Field:
            
            foreach ($rules as $rule) {
                $this->setRule($fieldNameOrArray, $rule);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
public function setRules($fieldNameOrArray, $rules = [])
    {
        // Determine Parameter Mode:
        
        if (is_array($fieldNameOrArray)) {
            
            // Define All Rules:
            
            foreach ($fieldNameOrArray as $fieldName => $rules) {
                $this->setRules($fieldName, $rules);
            }
            
        } else {
            
            // Define Rules for Specified Field:
            
            foreach ($rules as $rule) {
                $this->setRule($fieldNameOrArray, $rule);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
public function setRules ( $ fieldNameOrArray , $ rules = [ ] ) { // Determine Parameter Mode: if ( is_array ( $ fieldNameOrArray ) ) { // Define All Rules: foreach ( $ fieldNameOrArray as $ fieldName => $ rules ) { $ this -> setRules ( $ fieldName , $ rules ) ; } } else { // Define Rules for Specified Field: foreach ( $ rules as $ rule ) { $ this -> setRule ( $ fieldNameOrArray , $ rule ) ; } } // Answer Self: return $ this ; }
Sets the rules for the form field with the given name from the given array, or the entire list of rules.

@param string|array $fieldNameOrArray
@param array $rules

@return $this
Sets the rules for the form field with the given name from the given array or the entire list of rules .