MCPcopy Index your code
hub / github.com/cloudreve/cloudreve / Clone

Method Clone

ent/node_query.go:267–282  ·  view source on GitHub ↗

Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

()

Source from the content-addressed store, hash-verified

265// Clone returns a duplicate of the NodeQuery builder, including all associated steps. It can be
266// used to prepare common query builders and use them differently after the clone is made.
267func (nq *NodeQuery) Clone() *NodeQuery {
268 if nq == nil {
269 return nil
270 }
271 return &NodeQuery{
272 config: nq.config,
273 ctx: nq.ctx.Clone(),
274 order: append([]node.OrderOption{}, nq.order...),
275 inters: append([]Interceptor{}, nq.inters...),
276 predicates: append([]predicate.Node{}, nq.predicates...),
277 withStoragePolicy: nq.withStoragePolicy.Clone(),
278 // clone intermediate query.
279 sql: nq.sql.Clone(),
280 path: nq.path,
281 }
282}
283
284// WithStoragePolicy tells the query-builder to eager-load the nodes that are connected to
285// the "storage_policy" edge. The optional arguments are used to configure the query builder of the edge.

Callers 13

cloneMethod · 0.45
ServeMethod · 0.45
FlattenListFilesMethod · 0.45
ListEntitiesMethod · 0.45
offsetPaginationMethod · 0.45
ListNodesMethod · 0.45
cursorPaginationMethod · 0.45
offsetPaginationMethod · 0.45
ListMethod · 0.45
ListGroupsMethod · 0.45
offsetPaginationMethod · 0.45
ListPoliciesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected