; /** * @ORM\Column(type="datetimetz", nullable=true) * @var DateTimeInterface|null */ private $lastOpenAt; /** * @ORM\Column(type="datetimetz", nullable=true) * @var DateTimeInterface|null */ private $lastClickAt; /** * @ORM\Column(type="datetimetz", nullable=true) * @var DateTimeInterface|null */ private $lastPurchaseAt; /** * @ORM\Column(type="datetimetz", nullable=true) * @var DateTimeInterface|null */ private $lastPageViewAt; /** * @ORM\Column(type="datetimetz", nullable=true) * @var DateTimeInterface|null */ private $woocommerceSyncedAt; /** * @ORM\Column(type="integer") * @var int */ private $emailCount = 0; /** * @ORM\OneToMany(targetEntity="MailPoet\Entities\SubscriberSegmentEntity", mappedBy="subscriber", orphanRemoval=true) * @var Collection */ private $subscriberSegments; /** * @ORM\OneToMany(targetEntity="MailPoet\Entities\SubscriberCustomFieldEntity", mappedBy="subscriber", orphanRemoval=true) * @var Collection */ private $subscriberCustomFields; /** * @ORM\OneToMany(targetEntity="MailPoet\Entities\SubscriberTagEntity", mappedBy="subscriber", orphanRemoval=true) * @var Collection */ private $subscriberTags; /** * @ORM\OneToMany(targetEntity="MailPoet\Entities\ScheduledTaskSubscriberEntity", mappedBy="subscriber", orphanRemoval=true) * @var Collection */ private $scheduledTaskSubscribers; public function __construct() { $this->subscriberSegments = new ArrayCollection(); $this->subscriberCustomFields = new ArrayCollection(); $this->subscriberTags = new ArrayCollection(); $this->scheduledTaskSubscribers = 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); } } /** * @return int|null */ public function getWpUserId() { return $this->wpUserId ? (int)$this->wpUserId : null; } /** * @param int|null $wpUserId */ public function setWpUserId($wpUserId) { $this->wpUserId = $wpUserId ? (string)$wpUserId : null; } public function isWPUser(): bool { return $this->getWpUserId() > 0; } /** * @return bool */ public function getIsWoocommerceUser() { return $this->isWoocommerceUser; } /** * @param bool $isWoocommerceUser */ public function setIsWoocommerceUser($isWoocommerceUser) { $this->isWoocommerceUser = $isWoocommerceUser; } /** * @return string */ public function getFirstName() { return $this->firstName; } /** * @param string $firstName */ public function setFirstName($firstName) { $this->firstName = $firstName; } /** * @return string */ public function getLastName() { return $this->lastName; } /** * @param string $lastName */ public function setLastName($lastName) { $this->lastName = $lastName; } /** * @return string */ public function getEmail() { return $this->email; } /** * @param string $email */ public function setEmail($email) { $this->email = $email; } /** * @return string */ public function getStatus() { return $this->status; } /** * @param string $status */ public function setStatus($status) { if ( !in_array($status, [ self::STATUS_BOUNCED, self::STATUS_INACTIVE, self::STATUS_SUBSCRIBED, self::STATUS_UNCONFIRMED, self::STATUS_UNSUBSCRIBED, ]) ) { throw new \InvalidArgumentException("Invalid status '{$status}' given to subscriber!"); } $this->status = $status; } /** * @return string|null */ public function getSubscribedIp() { return $this->subscribedIp; } /** * @param string $subscribedIp */ public function setSubscribedIp($subscribedIp) { $this->subscribedIp = $subscribedIp; } /** * @return string|null */ public function getConfirmedIp() { return $this->confirmedIp; } /** * @param string|null $confirmedIp */ public function setConfirmedIp($confirmedIp) { $this->confirmedIp = $confirmedIp; } /** * @return DateTimeInterface|null */ public function getConfirmedAt() { return $this->confirmedAt; } /** * @param DateTimeInterface|null $confirmedAt */ public function setConfirmedAt($confirmedAt) { $this->confirmedAt = $confirmedAt; } /** * @return DateTimeInterface|null */ public function getLastSubscribedAt() { return $this->lastSubscribedAt; } /** * @param DateTimeInterface|null $lastSubscribedAt */ public function setLastSubscribedAt($lastSubscribedAt) { $this->lastSubscribedAt = $lastSubscribedAt; } /** * @return string|null */ public function getUnconfirmedData() { return $this->unconfirmedData; } /** * @param string|null $unconfirmedData */ public function setUnconfirmedData($unconfirmedData) { $this->unconfirmedData = $unconfirmedData; } /** * @return string */ public function getSource() { return $this->source; } /** * @param string $source */ public function setSource($source) { if ( !in_array($source, [ 'api', 'form', 'unknown', 'imported', 'administrator', 'wordpress_user', 'woocommerce_user', 'woocommerce_checkout', ]) ) { throw new \InvalidArgumentException("Invalid source '{$source}' given to subscriber!"); } $this->source = $source; } /** * @return int */ public function getConfirmationsCount() { return $this->countConfirmations; } /** * @param int $countConfirmations */ public function setConfirmationsCount($countConfirmations) { $this->countConfirmations = $countConfirmations; } /** * @return string|null */ public function getUnsubscribeToken() { return $this->unsubscribeToken; } /** * @param string|null $unsubscribeToken */ public function setUnsubscribeToken($unsubscribeToken) { $this->unsubscribeToken = $unsubscribeToken; } /** * @return string|null */ public function getLinkToken() { return $this->linkToken; } /** * @param string|null $linkToken */ public function setLinkToken($linkToken) { $this->linkToken = $linkToken; } /** * @return Collection */ public function getSubscriberSegments(?string $status = null) { if (!is_null($status)) { $criteria = Criteria::create() ->where(Criteria::expr()->eq('status', $status)); $subscriberSegments = $this->subscriberSegments->matching($criteria); } else { $subscriberSegments = $this->subscriberSegments; } return $subscriberSegments; } /** * @return Collection */ public function getSegments() { return $this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment = null) { if (!$subscriberSegment) return null; return $subscriberSegment->getSegment(); })->filter(function (?SegmentEntity $segment = null) { return $segment !== null; }); } /** * @return Collection */ public function getSubscriberCustomFields() { return $this->subscriberCustomFields; } public function getSubscriberCustomField(CustomFieldEntity $customField): ?SubscriberCustomFieldEntity { $criteria = Criteria::create() ->where(Criteria::expr()->eq('customField', $customField)) ->setMaxResults(1); return $this->getSubscriberCustomFields()->matching($criteria)->first() ?: null; } /** * @return Collection */ public function getSubscriberTags() { return $this->subscriberTags; } public function getSubscriberTag(TagEntity $tag): ?SubscriberTagEntity { $criteria = Criteria::create() ->where(Criteria::expr()->eq('tag', $tag)) ->setMaxResults(1); return $this->getSubscriberTags()->matching($criteria)->first() ?: null; } /** * @return float|null */ public function getEngagementScore(): ?float { return $this->engagementScore; } /** * @param float|null $engagementScore */ public function setEngagementScore(?float $engagementScore): void { $this->engagementScore = $engagementScore; } /** * @return DateTimeInterface|null */ public function getEngagementScoreUpdatedAt(): ?DateTimeInterface { return $this->engagementScoreUpdatedAt; } /** * @param DateTimeInterface|null $engagementScoreUpdatedAt */ public function setEngagementScoreUpdatedAt(?DateTimeInterface $engagementScoreUpdatedAt): void { $this->engagementScoreUpdatedAt = $engagementScoreUpdatedAt; } public function getLastEngagementAt(): ?DateTimeInterface { return $this->lastEngagementAt; } public function setLastEngagementAt(DateTimeInterface $lastEngagementAt): void { $this->lastEngagementAt = $lastEngagementAt; } public function getLastSendingAt(): ?DateTimeInterface { return $this->lastSendingAt; } public function setLastSendingAt(?DateTimeInterface $dateTime): void { $this->lastSendingAt = $dateTime; } public function getLastOpenAt(): ?DateTimeInterface { return $this->lastOpenAt; } public function setLastOpenAt(?DateTimeInterface $dateTime): void { $this->lastOpenAt = $dateTime; } public function getLastClickAt(): ?DateTimeInterface { return $this->lastClickAt; } public function setLastClickAt(?DateTimeInterface $dateTime): void { $this->lastClickAt = $dateTime; } public function getLastPurchaseAt(): ?DateTimeInterface { return $this->lastPurchaseAt; } public function setLastPurchaseAt(?DateTimeInterface $dateTime): void { $this->lastPurchaseAt = $dateTime; } public function getLastPageViewAt(): ?DateTimeInterface { return $this->lastPageViewAt; } public function setLastPageViewAt(?DateTimeInterface $dateTime): void { $this->lastPageViewAt = $dateTime; } public function setWoocommerceSyncedAt(?DateTimeInterface $woocommerceSyncedAt): void { $this->woocommerceSyncedAt = $woocommerceSyncedAt; } public function getWoocommerceSyncedAt(): ?DateTimeInterface { return $this->woocommerceSyncedAt; } public function getEmailCount(): int { return $this->emailCount; } public function setEmailCount(int $emailCount): void { $this->emailCount = $emailCount; } /** @ORM\PreFlush */ public function cleanupSubscriberSegments(): void { // Delete old orphan SubscriberSegments to avoid errors on update $this->subscriberSegments->map(function (SubscriberSegmentEntity $subscriberSegment = null) { if (!$subscriberSegment) return null; if ($subscriberSegment->getSegment() === null) { $this->subscriberSegments->removeElement($subscriberSegment); } }); } }
Fatal error: Uncaught ReflectionException: Class "MailPoet\Entities\SubscriberEntity" does not exist in /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/persistence/src/Persistence/Mapping/RuntimeReflectionService.php:45 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/persistence/src/Persistence/Mapping/RuntimeReflectionService.php(45): ReflectionClass->__construct('MailPoet\\Entiti...') #1 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(277): MailPoetVendor\Doctrine\Persistence\Mapping\RuntimeReflectionService->getClass('MailPoet\\Entiti...') #2 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(494): MailPoetVendor\Doctrine\ORM\Mapping\ClassMetadataInfo->wakeupReflection(Object(MailPoetVendor\Doctrine\Persistence\Mapping\RuntimeReflectionService)) #3 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/persistence/src/Persistence/Mapping/AbstractClassMetadataFactory.php(106): MailPoetVendor\Doctrine\ORM\Mapping\ClassMetadataFactory->wakeupReflection(Object(MailPoetVendor\Doctrine\ORM\Mapping\ClassMetadata), Object(MailPoetVendor\Doctrine\Persistence\Mapping\RuntimeReflectionService)) #4 /htdocs/wp-content/plugins/mailpoet/lib/Doctrine/TablePrefixMetadataFactory.php(44): MailPoetVendor\Doctrine\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('MailPoet\\Entiti...') #5 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(143): MailPoet\Doctrine\TablePrefixMetadataFactory->getMetadataFor('MailPoet\\Entiti...') #6 /htdocs/wp-content/plugins/mailpoet/lib/Doctrine/Repository.php(36): MailPoetVendor\Doctrine\ORM\EntityManager->getClassMetadata('MailPoet\\Entiti...') #7 /htdocs/wp-content/plugins/mailpoet/lib/Subscribers/SubscribersRepository.php(55): MailPoet\Doctrine\Repository->__construct(Object(MailPoetVendor\Doctrine\ORM\EntityManager)) #8 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5298): MailPoet\Subscribers\SubscribersRepository->__construct(Object(MailPoetVendor\Doctrine\ORM\EntityManager), Object(MailPoet\Config\SubscriberChangesNotifier), Object(MailPoet\WP\Functions), Object(MailPoet\Segments\SegmentsRepository)) #9 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2636): MailPoetGenerated\FreeCachedContainer->getSubscribersRepositoryService() #10 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #11 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #12 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #13 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #14 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #15 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #16 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #17 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #18 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #19 /htdocs/index.php(17): require('/htdocs/wp-blog...') #20 {main} thrown in /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/doctrine/persistence/src/Persistence/Mapping/RuntimeReflectionService.php on line 45