Use new code style
This commit is contained in:
@ -107,7 +107,5 @@ class Domain_Query extends Query {
|
||||
public function __construct($query = array()) {
|
||||
|
||||
parent::__construct($query);
|
||||
|
||||
} // end __construct;
|
||||
|
||||
} // end class Domain_Query;
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace WP_Ultimo\Database\Domains;
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
use \WP_Ultimo\Database\Engine\Enum;
|
||||
use WP_Ultimo\Database\Engine\Enum;
|
||||
|
||||
/**
|
||||
* Domain Stage.
|
||||
@ -47,8 +47,7 @@ class Domain_Stage extends Enum {
|
||||
static::DONE => 'wu-bg-green-200 wu-text-green-700',
|
||||
static::DONE_WITHOUT_SSL => 'wu-bg-gray-800 wu-text-white',
|
||||
);
|
||||
|
||||
} // end classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with values => labels.
|
||||
@ -65,7 +64,5 @@ class Domain_Stage extends Enum {
|
||||
static::DONE => __('Ready', 'wp-ultimo'),
|
||||
static::DONE_WITHOUT_SSL => __('Ready (without SSL)', 'wp-ultimo'),
|
||||
);
|
||||
|
||||
} // end labels;
|
||||
|
||||
} // end class Domain_Stage;
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class Domains_Schema extends Schema {
|
||||
'unsigned' => true,
|
||||
'extra' => 'auto_increment',
|
||||
'primary' => true,
|
||||
'sortable' => true
|
||||
'sortable' => true,
|
||||
),
|
||||
|
||||
array(
|
||||
@ -117,5 +117,4 @@ class Domains_Schema extends Schema {
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
} // end class Domains_Schema;
|
||||
}
|
||||
|
@ -22,11 +22,11 @@ defined('ABSPATH') || exit;
|
||||
final class Domains_Table extends Table {
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @var string
|
||||
*/
|
||||
* Table name
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'domain_mappings';
|
||||
|
||||
/**
|
||||
@ -64,8 +64,7 @@ final class Domains_Table extends Table {
|
||||
public function __construct() {
|
||||
|
||||
parent::__construct();
|
||||
|
||||
} // end __construct;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the database schema
|
||||
@ -88,8 +87,7 @@ final class Domains_Table extends Table {
|
||||
PRIMARY KEY (id),
|
||||
KEY blog_id (blog_id,domain,active),
|
||||
KEY domain (domain)";
|
||||
|
||||
} // end set_schema;
|
||||
}
|
||||
/**
|
||||
* Fixes the datetime columns to accept null.
|
||||
*
|
||||
@ -103,21 +101,15 @@ final class Domains_Table extends Table {
|
||||
);
|
||||
|
||||
foreach ($null_columns as $column) {
|
||||
|
||||
$query = "ALTER TABLE {$this->table_name} MODIFY COLUMN `{$column}` datetime DEFAULT NULL;";
|
||||
|
||||
$result = $this->get_db()->query($query);
|
||||
|
||||
if (!$this->is_success($result)) {
|
||||
|
||||
if ( ! $this->is_success($result)) {
|
||||
return false;
|
||||
|
||||
} // end if;
|
||||
|
||||
} // end foreach;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
} // end __20230601;
|
||||
|
||||
} // end class Domains_Table;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user