install() public method

Installs the given table.
Since: 3.0.0
public install ( Inpsyde\MultilingualPress\Database\Table $table = null ) : boolean
$table Inpsyde\MultilingualPress\Database\Table Optional. Table object. Defaults to null.
return boolean Whether or not the table was installed successfully.
Beispiel #1
0
 /**
  * Updates any installed plugin data to the current version.
  *
  * @since 3.0.0
  *
  * @param VersionNumber  $installed_version       Installed MultilingualPress version.
  *
  * @return void
  */
 public function update(VersionNumber $installed_version)
 {
     if (VersionNumber::FALLBACK_VERSION === $installed_version) {
         // TODO: Move either to separate class or method on an existing class in the Language API namespace.
         $this->import_active_languages();
     }
     if (version_compare($installed_version, '2.0.4', '<')) {
         $this->table_installer->install($this->site_relations_table);
         $this->import_site_relations();
         if (version_compare($installed_version, '2.3.2', '<')) {
             $this->update_type_column();
         }
     }
     // Remove obsolete plugin data.
     delete_option('inpsyde_companyname');
 }
 /**
  * Performs installation-specific tasks.
  *
  * @since 3.0.0
  *
  * @return void
  */
 public function install()
 {
     $this->table_installer->install($this->content_relations_table);
     $this->table_installer->install($this->languages_table);
     $this->table_installer->install($this->site_relations_table);
 }