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

Method ResetField

ent/mutation.go:12386–12417  ·  view source on GitHub ↗

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

(name string)

Source from the content-addressed store, hash-verified

12384// ResetField resets all changes in the mutation for the field with the given name.
12385// It returns an error if the field is not defined in the schema.
12386func (m *ShareMutation) ResetField(name string) error {
12387 switch name {
12388 case share.FieldCreatedAt:
12389 m.ResetCreatedAt()
12390 return nil
12391 case share.FieldUpdatedAt:
12392 m.ResetUpdatedAt()
12393 return nil
12394 case share.FieldDeletedAt:
12395 m.ResetDeletedAt()
12396 return nil
12397 case share.FieldPassword:
12398 m.ResetPassword()
12399 return nil
12400 case share.FieldViews:
12401 m.ResetViews()
12402 return nil
12403 case share.FieldDownloads:
12404 m.ResetDownloads()
12405 return nil
12406 case share.FieldExpires:
12407 m.ResetExpires()
12408 return nil
12409 case share.FieldRemainDownloads:
12410 m.ResetRemainDownloads()
12411 return nil
12412 case share.FieldProps:
12413 m.ResetProps()
12414 return nil
12415 }
12416 return fmt.Errorf("unknown Share field %s", name)
12417}
12418
12419// AddedEdges returns all edge names that were set/added in this mutation.
12420func (m *ShareMutation) AddedEdges() []string {

Callers

nothing calls this directly

Calls 9

ResetCreatedAtMethod · 0.95
ResetUpdatedAtMethod · 0.95
ResetDeletedAtMethod · 0.95
ResetPasswordMethod · 0.95
ResetViewsMethod · 0.95
ResetDownloadsMethod · 0.95
ResetExpiresMethod · 0.95
ResetRemainDownloadsMethod · 0.95
ResetPropsMethod · 0.95

Tested by

no test coverage detected