Add deprecation error to old model static calls

[MAILPOET-3484]
This commit is contained in:
wxa
2021-03-29 09:11:11 +03:00
committed by Veljko V
parent 2947a5a299
commit 91b2a11643

View File

@ -116,6 +116,14 @@ class DynamicSegment extends MailPoetSegment {
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 ' . $methodName . ' is deprecated and will be removed. Use MailPoet\Segments\DynamicSegments\DynamicSegmentsListingRepository and respective Doctrine entities instead.', E_USER_DEPRECATED);
}