QueryAlerts queries the alerts edge of a Machine.
(_m *Machine)
| 1589 | |
| 1590 | // QueryAlerts queries the alerts edge of a Machine. |
| 1591 | func (c *MachineClient) QueryAlerts(_m *Machine) *AlertQuery { |
| 1592 | query := (&AlertClient{config: c.config}).Query() |
| 1593 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1594 | id := _m.ID |
| 1595 | step := sqlgraph.NewStep( |
| 1596 | sqlgraph.From(machine.Table, machine.FieldID, id), |
| 1597 | sqlgraph.To(alert.Table, alert.FieldID), |
| 1598 | sqlgraph.Edge(sqlgraph.O2M, false, machine.AlertsTable, machine.AlertsColumn), |
| 1599 | ) |
| 1600 | fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step) |
| 1601 | return fromV, nil |
| 1602 | } |
| 1603 | return query |
| 1604 | } |
| 1605 | |
| 1606 | // Hooks returns the client hooks. |
| 1607 | func (c *MachineClient) Hooks() []Hook { |