class-wpml-st-upgrade-db-string-packages-word-count.php
876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
class WPML_ST_Upgrade_DB_String_Packages_Word_Count implements IWPML_St_Upgrade_Command {
/** @var WPML_Upgrade_Schema $upgrade_schema */
private $upgrade_schema;
public function __construct( WPML_Upgrade_Schema $upgrade_schema ) {
$this->upgrade_schema = $upgrade_schema;
}
public function run() {
$table = 'icl_string_packages';
$column = 'word_count';
if ( ! $this->upgrade_schema->does_table_exist( $table ) ) {
return false;
}
if ( ! $this->upgrade_schema->does_column_exist( $table, $column ) ) {
return (bool) $this->upgrade_schema->add_column( $table, $column, 'VARCHAR(2000) DEFAULT NULL' );
}
return true;
}
public function run_ajax() {
return $this->run();
}
public function run_frontend() {
return $this->run();
}
/**
* @return string
*/
public static function get_command_id() {
return __CLASS__;
}
}