Add magic getters for backward compatibility
[MAILPOET-3333]
This commit is contained in:
@@ -8,6 +8,7 @@ use MailPoet\Doctrine\EntityTraits\CreatedAtTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\DeletedAtTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\SafeToOneAssociationLoadTrait;
|
||||
use MailPoet\Doctrine\EntityTraits\UpdatedAtTrait;
|
||||
use MailPoet\Util\Helpers;
|
||||
use MailPoetVendor\Doctrine\Common\Collections\ArrayCollection;
|
||||
use MailPoetVendor\Doctrine\Common\Collections\Criteria;
|
||||
use MailPoetVendor\Doctrine\ORM\Mapping as ORM;
|
||||
@@ -157,6 +158,18 @@ class NewsletterEntity {
|
||||
$this->queues = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This is here only for backward compatibility with custom shortcodes https://kb.mailpoet.com/article/160-create-a-custom-shortcode
|
||||
* This can be removed after 2021-08-01
|
||||
*/
|
||||
public function __get($key) {
|
||||
$getterName = 'get' . Helpers::underscoreToCamelCase($key, $capitaliseFirstChar = true);
|
||||
$callable = [$this, $getterName];
|
||||
if (is_callable($callable)) {
|
||||
return call_user_func($callable);
|
||||
}
|
||||
}
|
||||
|
||||
public function __clone() {
|
||||
// reset ID
|
||||
$this->id = null;
|
||||
|
Reference in New Issue
Block a user