protected function getPrefixedRules($rules, $prefix = '', $forceOptional = false)
    {
        if( $prefix == '' ) {
            return $rules;
        }

        $results = array();
        foreach( $rules as $key => $value ) {
            if( $forceOptional ) {
                $value = $this->makeOptional( $value );
            }

            $results[ $prefix .'_'. $key ] = $value;
        }

        return $results;
    }
protected function getPrefixedRules($rules, $prefix = '', $forceOptional = false)
    {
        if( $prefix == '' ) {
            return $rules;
        }

        $results = array();
        foreach( $rules as $key => $value ) {
            if( $forceOptional ) {
                $value = $this->makeOptional( $value );
            }

            $results[ $prefix .'_'. $key ] = $value;
        }

        return $results;
    }
protected function getPrefixedRules ( $ rules , $ prefix = '' , $ forceOptional = false ) { if ( $ prefix == '' ) { return $ rules ; } $ results = array ( ) ; foreach ( $ rules as $ key => $ value ) { if ( $ forceOptional ) { $ value = $ this -> makeOptional ( $ value ) ; } $ results [ $ prefix . '_' . $ key ] = $ value ; } return $ results ; }
Return the validation rules that need to be applied to a specific model form

@param   array $rules                Name of the form for which the rules will be used
@param   string $prefix              Prefix that is to be applied to the form rules
@param   boolean $forceOptional      Force all rules to be optional
@return array
Return the validation rules that need to be applied to a specific model form