public function generateRules($attributes)
    {
        $rules = [];
        $safeAttributes = [];
        foreach ($attributes as $attribute) {
            if ($attribute == '_id') {
                continue;
            }
            $safeAttributes[] = $attribute;
        }
        if (!empty($safeAttributes)) {
            $rules[] = "[['" . implode("', '", $safeAttributes) . "'], 'safe']";
        }
        return $rules;
    }
public function generateRules($attributes)
    {
        $rules = [];
        $safeAttributes = [];
        foreach ($attributes as $attribute) {
            if ($attribute == '_id') {
                continue;
            }
            $safeAttributes[] = $attribute;
        }
        if (!empty($safeAttributes)) {
            $rules[] = "[['" . implode("', '", $safeAttributes) . "'], 'safe']";
        }
        return $rules;
    }
public function generateRules ( $ attributes ) { $ rules = [ ] ; $ safeAttributes = [ ] ; foreach ( $ attributes as $ attribute ) { if ( $ attribute == '_id' ) { continue ; } $ safeAttributes [ ] = $ attribute ; } if ( ! empty ( $ safeAttributes ) ) { $ rules [ ] = "[['" . implode ( "', '" , $ safeAttributes ) . "'], 'safe']" ; } return $ rules ; }
Generates validation rules for the specified collection.
@param array $attributes the list of attributes
@return array the generated validation rules
Generates validation rules for the specified collection .