PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / InstallActions / Migrations / EnsureOrdersTable.php

EnsureOrdersTable.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/Services/InstallActions/Migrations/EnsureOrdersTable.php

36 lines 880 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\InstallActions\Migrations;
4
5 use IvyForms\Common\Exceptions\InvalidArgumentException;
6 use IvyForms\Services\InstallActions\DB\Payment\OrdersTable;
7
8 /**
9 * Creates the orders table on existing installs that were not re-activated after the feature shipped.
10 */
11 class EnsureOrdersTable
12 {
13 /**
14 * @return bool
15 */
16 public static function run(): bool
17 {
18 global $wpdb;
19
20 try {
21 $tableName = OrdersTable::getTableName();
22 } catch (InvalidArgumentException $e) {
23 return false;
24 }
25
26 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.DirectQuery
27 if ($wpdb->get_var($wpdb->prepare('SHOW TABLES LIKE %s', $tableName)) === $tableName) {
28 return true;
29 }
30
31 OrdersTable::init();
32
33 return true;
34 }
35 }
36