Deprecate MappingToExternalEntities model and stop creating its table
Since we are removing all the MP2 migration code the table wp_mailpoet_mapping_to_external_entities is not needed anymore. It was used to map MP2 objects to MP3 objects. This commit removes the code that creates this table for new installs and deprecates its model. [MAILPOET-4376]
This commit is contained in:
@ -66,7 +66,6 @@ class Migrator {
|
||||
'statistics_unsubscribes',
|
||||
'statistics_forms',
|
||||
'statistics_woocommerce_purchases',
|
||||
'mapping_to_external_entities',
|
||||
'log',
|
||||
'user_flags',
|
||||
'feature_flags',
|
||||
@ -561,18 +560,6 @@ class Migrator {
|
||||
return $this->sqlify(__FUNCTION__, $attributes);
|
||||
}
|
||||
|
||||
public function mappingToExternalEntities() {
|
||||
$attributes = [
|
||||
'old_id int(11) unsigned NOT NULL,',
|
||||
'type varchar(50) NOT NULL,',
|
||||
'new_id int(11) unsigned NOT NULL,',
|
||||
'created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,',
|
||||
'PRIMARY KEY (old_id, type),',
|
||||
'KEY new_id (new_id)',
|
||||
];
|
||||
return $this->sqlify(__FUNCTION__, $attributes);
|
||||
}
|
||||
|
||||
public function log() {
|
||||
$attributes = [
|
||||
'id bigint(20) unsigned NOT NULL AUTO_INCREMENT,',
|
||||
|
@ -2,12 +2,37 @@
|
||||
|
||||
namespace MailPoet\Models;
|
||||
|
||||
/**
|
||||
* @deprecated This model is deprecated and there is no replacement.
|
||||
* This class can be removed after 2023-01-06.
|
||||
*/
|
||||
class MappingToExternalEntities extends Model {
|
||||
public static $_table = MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
|
||||
|
||||
/**
|
||||
* @deprecated This is here for displaying the deprecation warning for properties.
|
||||
*/
|
||||
public function __get($key) {
|
||||
self::deprecationError('property "' . $key . '"');
|
||||
return parent::__get($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This is here for displaying the deprecation warning for static calls.
|
||||
*/
|
||||
public static function __callStatic($name, $arguments) {
|
||||
self::deprecationError($name);
|
||||
return parent::__callStatic($name, $arguments);
|
||||
}
|
||||
|
||||
public static function create($data = []) {
|
||||
self::deprecationError(__METHOD__);
|
||||
$relation = parent::create();
|
||||
$relation->hydrate($data);
|
||||
return $relation->save();
|
||||
}
|
||||
|
||||
private static function deprecationError($methodName) {
|
||||
trigger_error(' Calling ' . esc_html($methodName) . ' is deprecated and will be removed. There is no replacement.', E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user