MCPcopy Create free account
hub / github.com/pydio/cells / Build

Method Build

common/proto/tree/node.go:771–823  ·  view source on GitHub ↗
(builder clause.Builder)

Source from the content-addressed store, hash-verified

769}
770
771func (me MPathLike) Build(builder clause.Builder) {
772 var done bool
773 var expr []clause.Expression
774
775 if val := me.Value.GetMPath4(); val != "" {
776 if !done {
777 if val != "" && len(val) < 255 {
778 val += "."
779 }
780 val += "%"
781 done = true
782 }
783 expr = append(expr, clause.Like{Column: me.Alias + "mpath4", Value: val})
784 }
785 if val := me.Value.GetMPath3(); val != "" {
786 if !done {
787 if val != "" && len(val) < 255 {
788 val += "."
789 }
790 val += "%"
791 done = true
792 }
793 expr = append(expr, clause.Like{Column: me.Alias + "mpath3", Value: val})
794 }
795 if val := me.Value.GetMPath2(); val != "" {
796 if !done {
797 if val != "" && len(val) < 255 {
798 val += "."
799 }
800 val += "%"
801 done = true
802 }
803 expr = append(expr, clause.Like{Column: me.Alias + "mpath2", Value: val})
804 }
805 if val := me.Value.GetMPath1(); val != "" {
806 if !done {
807 if val != "" && len(val) < 255 {
808 val += "."
809 }
810 val += "%"
811 done = true
812 }
813 expr = append(expr, clause.Like{Column: me.Alias + "mpath1", Value: val})
814 }
815
816 if len(expr) == 0 {
817 expr = append(expr, clause.Like{Column: me.Alias + "mpath1", Value: "%"})
818 }
819
820 // expr = append(expr, clause.Gt{Column: me.Alias + "level", Value: me.Value.Length()})
821
822 clause.And(expr...).Build(builder)
823}
824
825// MPathEqualsOrLike greater than for where
826type MPathEqualsOrLike struct {

Callers

nothing calls this directly

Calls 6

GetMPath4Method · 0.65
GetMPath3Method · 0.65
GetMPath2Method · 0.65
GetMPath1Method · 0.65
BuildMethod · 0.65
AndMethod · 0.65

Tested by

no test coverage detected