Skip to content
Snippets Groups Projects
Commit af35c57f authored by Pavel Antonov's avatar Pavel Antonov :asterisk:
Browse files

Merge branch 'feature/3014-itemsFilterClone' into 'master'

Добавлен метод копирования фильтра items

See merge request perxis/perxis-go!419
parents a61977ad bd27e8db
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,22 @@ func NewFilter(params ...interface{}) *Filter { ...@@ -74,6 +74,22 @@ func NewFilter(params ...interface{}) *Filter {
return f return f
} }
func (f *Filter) Clone() *Filter {
if f == nil {
return nil
}
clone := &Filter{
ID: make([]string, len(f.ID)),
Data: make([]*filter.Filter, len(f.Data)),
Q: make([]string, len(f.Q)),
Search: f.Search,
}
copy(clone.ID, f.ID)
copy(clone.Data, f.Data)
copy(clone.Q, f.Q)
return clone
}
// AggregateExpRe - формат, которому должна соответствовать формула расчета данных // AggregateExpRe - формат, которому должна соответствовать формула расчета данных
var AggregateExpRe = regexp.MustCompile(`([a-zA-Z]+)\((.*)\)`) var AggregateExpRe = regexp.MustCompile(`([a-zA-Z]+)\((.*)\)`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment