table = $wpdb->prefix . 'mailpoet_automation_workflows'; $this->wpdb = $wpdb; } public function createWorkflow(Workflow $workflow): int { $result = $this->wpdb->insert($this->table, $workflow->toArray()); if (!$result) { throw Exceptions::databaseError($this->wpdb->last_error); } return $this->wpdb->insert_id; } }