Deprecate \MailPoet\Models\ScheduledTaskSubscriber::setSubscribers()

This model is no longer used since Sending::setSubscribers() was
refactored in a previous commit.

[MAILPOET-4368]
This commit is contained in:
Rodrigo Primo
2023-07-04 15:14:55 -03:00
committed by Aschepikov
parent 8fd8b8f193
commit 57129bd460

View File

@ -41,7 +41,11 @@ class ScheduledTaskSubscriber extends Model {
]);
}
/**
* @deprecated This method can be removed after 2024-01-04.
*/
public static function setSubscribers($taskId, array $subscriberIds) {
self::deprecationError(__METHOD__);
static::clearSubscribers($taskId);
return static::addSubscribers($taskId, $subscriberIds);
}
@ -77,4 +81,11 @@ class ScheduledTaskSubscriber extends Model {
}
return $orm->count();
}
private static function deprecationError($methodName) {
trigger_error(
'Calling ' . esc_html($methodName) . ' is deprecated and will be removed. Use \MailPoet\Newsletter\Sending\ScheduledTaskSubscribersRepository and \MailPoet\Entities\ScheduledTaskSubscriberEntity instead.',
E_USER_DEPRECATED
);
}
}