var WooCommerceCustomerTextField */ private $wooCommerceCustomerTextField; /** @var SubscriberDateField */ private $subscriberDateField; /** @var AutomationsEvents */ private $automationsEvents; /** @var WooCommerceNumberOfReviews */ private $wooCommerceNumberOfReviews; /** @var WooCommerceUsedCouponCode */ private $wooCommerceUsedCouponCode; /** @var WooCommerceFirstOrder */ private $wooCommerceFirstOrder; /** @var EmailsReceived */ private $emailsReceived; /** @var NumberOfClicks */ private $numberOfClicks; private WooCommercePurchasedWithAttribute $wooCommercePurchasedWithAttribute; private WooCommerceTag $wooCommerceTag; public function __construct( EmailAction $emailAction, EmailActionClickAny $emailActionClickAny, UserRole $userRole, MailPoetCustomFields $mailPoetCustomFields, WooCommerceProduct $wooCommerceProduct, WooCommerceCategory $wooCommerceCategory, WooCommerceCountry $wooCommerceCountry, WooCommerceCustomerTextField $wooCommerceCustomerTextField, EmailOpensAbsoluteCountAction $emailOpensAbsoluteCount, WooCommerceNumberOfOrders $wooCommerceNumberOfOrders, WooCommerceNumberOfReviews $wooCommerceNumberOfReviews, WooCommerceTotalSpent $wooCommerceTotalSpent, WooCommerceMembership $wooCommerceMembership, WooCommerceFirstOrder $wooCommerceFirstOrder, WooCommercePurchaseDate $wooCommercePurchaseDate, WooCommerceSubscription $wooCommerceSubscription, SubscriberScore $subscriberScore, SubscriberTag $subscriberTag, SubscriberSegment $subscriberSegment, SubscriberSubscribedViaForm $subscribedViaForm, WooCommerceSingleOrderValue $wooCommerceSingleOrderValue, WooCommerceAverageSpent $wooCommerceAverageSpent, WooCommerceTag $wooCommerceTag, WooCommerceUsedCouponCode $wooCommerceUsedCouponCode, WooCommerceUsedPaymentMethod $wooCommerceUsedPaymentMethod, WooCommerceUsedShippingMethod $wooCommerceUsedShippingMethod, SubscriberTextField $subscriberTextField, SubscriberDateField $subscriberDateField, AutomationsEvents $automationsEvents, EmailsReceived $emailsReceived, NumberOfClicks $numberOfClicks, WooCommercePurchasedWithAttribute $wooCommercePurchasedWithAttribute ) { $this->emailAction = $emailAction; $this->userRole = $userRole; $this->wooCommerceProduct = $wooCommerceProduct; $this->wooCommerceCategory = $wooCommerceCategory; $this->wooCommerceCountry = $wooCommerceCountry; $this->wooCommerceNumberOfOrders = $wooCommerceNumberOfOrders; $this->wooCommerceNumberOfReviews = $wooCommerceNumberOfReviews; $this->wooCommerceMembership = $wooCommerceMembership; $this->wooCommercePurchaseDate = $wooCommercePurchaseDate; $this->wooCommerceSubscription = $wooCommerceSubscription; $this->emailOpensAbsoluteCount = $emailOpensAbsoluteCount; $this->wooCommerceTotalSpent = $wooCommerceTotalSpent; $this->subscriberScore = $subscriberScore; $this->subscriberTag = $subscriberTag; $this->mailPoetCustomFields = $mailPoetCustomFields; $this->subscriberSegment = $subscriberSegment; $this->emailActionClickAny = $emailActionClickAny; $this->wooCommerceSingleOrderValue = $wooCommerceSingleOrderValue; $this->subscriberTextField = $subscriberTextField; $this->subscribedViaForm = $subscribedViaForm; $this->wooCommerceAverageSpent = $wooCommerceAverageSpent; $this->wooCommerceUsedPaymentMethod = $wooCommerceUsedPaymentMethod; $this->wooCommerceUsedShippingMethod = $wooCommerceUsedShippingMethod; $this->wooCommerceCustomerTextField = $wooCommerceCustomerTextField; $this->automationsEvents = $automationsEvents; $this->subscriberDateField = $subscriberDateField; $this->wooCommerceUsedCouponCode = $wooCommerceUsedCouponCode; $this->wooCommerceFirstOrder = $wooCommerceFirstOrder; $this->emailsReceived = $emailsReceived; $this->numberOfClicks = $numberOfClicks; $this->wooCommercePurchasedWithAttribute = $wooCommercePurchasedWithAttribute; $this->wooCommerceTag = $wooCommerceTag; } public function getFilterForFilterEntity(DynamicSegmentFilterEntity $filter): Filter { $filterData = $filter->getFilterData(); $filterType = $filterData->getFilterType(); $action = $filterData->getAction(); switch ($filterType) { case DynamicSegmentFilterData::TYPE_AUTOMATIONS: return $this->automationsEvents; case DynamicSegmentFilterData::TYPE_USER_ROLE: return $this->userRole($action); case DynamicSegmentFilterData::TYPE_EMAIL: return $this->email($action); case DynamicSegmentFilterData::TYPE_WOOCOMMERCE_MEMBERSHIP: return $this->wooCommerceMembership(); case DynamicSegmentFilterData::TYPE_WOOCOMMERCE_SUBSCRIPTION: return $this->wooCommerceSubscription(); case DynamicSegmentFilterData::TYPE_WOOCOMMERCE: return $this->wooCommerce($action); default: throw new InvalidFilterException('Invalid type', InvalidFilterException::INVALID_TYPE); } } /** * @param ?string $action * * @return MailPoetCustomFields|SubscriberScore|SubscriberSegment|UserRole|SubscriberTag|SubscriberTextField|SubscriberSubscribedViaForm|SubscriberDateField */ private function userRole(?string $action) { if ($action === SubscriberScore::TYPE) { return $this->subscriberScore; } elseif ($action === MailPoetCustomFields::TYPE) { return $this->mailPoetCustomFields; } elseif ($action === SubscriberSegment::TYPE) { return $this->subscriberSegment; } elseif ($action === SubscriberTag::TYPE) { return $this->subscriberTag; } elseif ($action === SubscriberSubscribedViaForm::TYPE) { return $this->subscribedViaForm; } elseif (in_array($action, SubscriberTextField::TYPES)) { return $this->subscriberTextField; } elseif (in_array($action, SubscriberDateField::TYPES)) { return $this->subscriberDateField; } return $this->userRole; } /** * @param ?string $action * @return EmailAction|EmailActionClickAny|EmailOpensAbsoluteCountAction|EmailsReceived|NumberOfClicks */ private function email(?string $action) { $countActions = [EmailOpensAbsoluteCountAction::TYPE, EmailOpensAbsoluteCountAction::MACHINE_TYPE]; if (in_array($action, $countActions)) { return $this->emailOpensAbsoluteCount; } elseif ($action === EmailActionClickAny::TYPE) { return $this->emailActionClickAny; } elseif ($action === EmailsReceived::ACTION) { return $this->emailsReceived; } elseif ($action === NumberOfClicks::ACTION) { return $this->numberOfClicks; } return $this->emailAction; } private function wooCommerceMembership(): WooCommerceMembership { return $this->wooCommerceMembership; } private function wooCommerceSubscription(): WooCommerceSubscription { return $this->wooCommerceSubscription; } /** * @param ?string $action * @return Filter */ private function wooCommerce(?string $action) { if ($action === WooCommerceProduct::ACTION_PRODUCT) { return $this->wooCommerceProduct; } elseif (in_array($action, WooCommerceNumberOfOrders::ACTIONS)) { return $this->wooCommerceNumberOfOrders; } elseif ($action === WooCommerceTotalSpent::ACTION_TOTAL_SPENT) { return $this->wooCommerceTotalSpent; } elseif ($action === WooCommerceCountry::ACTION_CUSTOMER_COUNTRY) { return $this->wooCommerceCountry; } elseif ($action === WooCommerceSingleOrderValue::ACTION_SINGLE_ORDER_VALUE) { return $this->wooCommerceSingleOrderValue; } elseif ($action === WooCommercePurchaseDate::ACTION) { return $this->wooCommercePurchaseDate; } elseif ($action === WooCommerceAverageSpent::ACTION) { return $this->wooCommerceAverageSpent; } elseif ($action === WooCommerceUsedPaymentMethod::ACTION) { return $this->wooCommerceUsedPaymentMethod; } elseif ($action === WooCommerceUsedShippingMethod::ACTION) { return $this->wooCommerceUsedShippingMethod; } elseif ($action === WooCommerceNumberOfReviews::ACTION) { return $this->wooCommerceNumberOfReviews; } elseif (in_array($action, WooCommerceCustomerTextField::ACTIONS)) { return $this->wooCommerceCustomerTextField; } elseif ($action === WooCommerceUsedCouponCode::ACTION) { return $this->wooCommerceUsedCouponCode; } elseif ($action === WooCommerceFirstOrder::ACTION) { return $this->wooCommerceFirstOrder; } elseif ($action === WooCommercePurchasedWithAttribute::ACTION) { return $this->wooCommercePurchasedWithAttribute; } elseif ($action == WooCommerceTag::ACTION) { return $this->wooCommerceTag; } return $this->wooCommerceCategory; } }
Fatal error: Uncaught Error: Class "MailPoet\Segments\DynamicSegments\FilterFactory" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:4348 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4141): MailPoetGenerated\FreeCachedContainer->getFilterFactoryService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(4031): MailPoetGenerated\FreeCachedContainer->getSendingQueuesRepositoryService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5088): MailPoetGenerated\FreeCachedContainer->getRenderer6Service() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5098): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailCustomizerService() #4 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5198): MailPoetGenerated\FreeCachedContainer->getConfirmationEmailMailerService() #5 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(5368): MailPoetGenerated\FreeCachedContainer->getSubscriberActionsService() #6 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2612): MailPoetGenerated\FreeCachedContainer->getCommentService() #7 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getHooks2Service() #8 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #9 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #10 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #11 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #12 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #13 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #14 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #15 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #16 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #17 /htdocs/index.php(17): require('/htdocs/wp-blog...') #18 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 4348