SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.
(id *int)
| 151 | |
| 152 | // SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil. |
| 153 | func (sc *ShareCreate) SetNillableUserID(id *int) *ShareCreate { |
| 154 | if id != nil { |
| 155 | sc = sc.SetUserID(*id) |
| 156 | } |
| 157 | return sc |
| 158 | } |
| 159 | |
| 160 | // SetUser sets the "user" edge to the User entity. |
| 161 | func (sc *ShareCreate) SetUser(u *User) *ShareCreate { |