Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
()
| 8207 | // Tx returns an `ent.Tx` for mutations that were executed in transactions; |
| 8208 | // it returns an error otherwise. |
| 8209 | func (m OrgInvitationMutation) Tx() (*Tx, error) { |
| 8210 | if _, ok := m.driver.(*txDriver); !ok { |
| 8211 | return nil, errors.New("ent: mutation is not running in a transaction") |
| 8212 | } |
| 8213 | tx := &Tx{config: m.config} |
| 8214 | tx.init() |
| 8215 | return tx, nil |
| 8216 | } |
| 8217 | |
| 8218 | // SetID sets the value of the id field. Note that this |
| 8219 | // operation is only accepted on creation of OrgInvitation entities. |