/** * @param \Generated\Shared\Transfer\NewsletterSubscriberTransfer $newsletterSubscriber * @param \Generated\Shared\Transfer\NewsletterTypeTransfer $newsletterType * * @return \Orm\Zed\Newsletter\Persistence\SpyNewsletterSubscription|null */ protected function getSubscription(NewsletterSubscriberTransfer $newsletterSubscriber, NewsletterTypeTransfer $newsletterType) { if ($newsletterSubscriber->getSubscriberKey() !== null) { $subscriptionEntity = $this->queryContainer->querySubscriptionBySubscriberKeyAndNewsletterTypeName($newsletterSubscriber->getSubscriberKey(), $newsletterType->getName())->findOne(); return $subscriptionEntity; } if ($newsletterSubscriber->getFkCustomer() !== null) { $subscriptionEntity = $this->queryContainer->querySubscriptionByIdCustomerAndNewsletterTypeName($newsletterSubscriber->getFkCustomer(), $newsletterType->getName())->findOne(); return $subscriptionEntity; } return null; }
/** * @param \Generated\Shared\Transfer\NewsletterSubscriptionRequestTransfer $request * * @return void */ protected function addTestType2ToSubscriptionRequest(NewsletterSubscriptionRequestTransfer $request) { $type2 = new NewsletterTypeTransfer(); $type2->setName(self::TEST_TYPE2); $request->addSubscriptionType($type2); }