Deprecate NewsletterSegment model as it is not used anymore
[MAILPOET-5763]
This commit is contained in:
@ -6,7 +6,33 @@ namespace MailPoet\Models;
|
|||||||
* @property int $newsletterId
|
* @property int $newsletterId
|
||||||
* @property int $segmentId
|
* @property int $segmentId
|
||||||
* @property string $updatedAt
|
* @property string $updatedAt
|
||||||
|
*
|
||||||
|
* @deprecated This model is deprecated. Use \MailPoet\Newsletter\Segment\NewsletterSegmentRepository
|
||||||
|
* and \MailPoet\Entities\NewsletterSegmentEntity instead. This class can be removed after 2024-05-30.
|
||||||
*/
|
*/
|
||||||
class NewsletterSegment extends Model {
|
class NewsletterSegment extends Model {
|
||||||
public static $_table = MP_NEWSLETTER_SEGMENT_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
|
public static $_table = MP_NEWSLETTER_SEGMENT_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);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function deprecationError($methodName) {
|
||||||
|
trigger_error(
|
||||||
|
'Calling ' . esc_html($methodName) . ' is deprecated and will be removed. Use \MailPoet\Newsletter\Segment\NewsletterSegmentRepository and \MailPoet\Entities\NewsletterSegmentEntity instead.',
|
||||||
|
E_USER_DEPRECATED
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user