Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
(name string)
| 12146 | // return value indicates that this field was not set, or was not defined in the |
| 12147 | // schema. |
| 12148 | func (m *ShareMutation) Field(name string) (ent.Value, bool) { |
| 12149 | switch name { |
| 12150 | case share.FieldCreatedAt: |
| 12151 | return m.CreatedAt() |
| 12152 | case share.FieldUpdatedAt: |
| 12153 | return m.UpdatedAt() |
| 12154 | case share.FieldDeletedAt: |
| 12155 | return m.DeletedAt() |
| 12156 | case share.FieldPassword: |
| 12157 | return m.Password() |
| 12158 | case share.FieldViews: |
| 12159 | return m.Views() |
| 12160 | case share.FieldDownloads: |
| 12161 | return m.Downloads() |
| 12162 | case share.FieldExpires: |
| 12163 | return m.Expires() |
| 12164 | case share.FieldRemainDownloads: |
| 12165 | return m.RemainDownloads() |
| 12166 | case share.FieldProps: |
| 12167 | return m.Props() |
| 12168 | } |
| 12169 | return nil, false |
| 12170 | } |
| 12171 | |
| 12172 | // OldField returns the old value of the field from the database. An error is |
| 12173 | // returned if the mutation operation is not UpdateOne, or the query to the |