MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / Clone

Method Clone

ent/share_query.go:291–307  ·  view source on GitHub ↗

Clone returns a duplicate of the ShareQuery 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

289// Clone returns a duplicate of the ShareQuery builder, including all associated steps. It can be
290// used to prepare common query builders and use them differently after the clone is made.
291func (sq *ShareQuery) Clone() *ShareQuery {
292 if sq == nil {
293 return nil
294 }
295 return &ShareQuery{
296 config: sq.config,
297 ctx: sq.ctx.Clone(),
298 order: append([]share.OrderOption{}, sq.order...),
299 inters: append([]Interceptor{}, sq.inters...),
300 predicates: append([]predicate.Share{}, sq.predicates...),
301 withUser: sq.withUser.Clone(),
302 withFile: sq.withFile.Clone(),
303 // clone intermediate query.
304 sql: sq.sql.Clone(),
305 path: sq.path,
306 }
307}
308
309// WithUser tells the query-builder to eager-load the nodes that are connected to
310// the "user" edge. The optional arguments are used to configure the query builder of the edge.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected