mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/mutation: explain when object is fetched from db (#496)
This commit is contained in:
@@ -141,7 +141,9 @@ func (m *CardMutation) Number() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldNumber returns the old number value, if exists.
|
||||
// OldNumber returns the old number value of the Card.
|
||||
// If the Card object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *CardMutation) OldNumber(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
@@ -176,7 +178,9 @@ func (m *CardMutation) Name() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldName returns the old name value, if exists.
|
||||
// OldName returns the old name value of the Card.
|
||||
// If the Card object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *CardMutation) OldName(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
@@ -224,7 +228,9 @@ func (m *CardMutation) CreatedAt() (r time.Time, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldCreatedAt returns the old created_at value, if exists.
|
||||
// OldCreatedAt returns the old created_at value of the Card.
|
||||
// If the Card object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *CardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
@@ -631,7 +637,9 @@ func (m *UserMutation) Name() (r string, exists bool) {
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldName returns the old name value, if exists.
|
||||
// OldName returns the old name value of the User.
|
||||
// If the User object wasn't provided to the builder, the object is fetched
|
||||
// from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or database query fails.
|
||||
func (m *UserMutation) OldName(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
|
||||
Reference in New Issue
Block a user