Remove Premium namespace from dynamic segments
[MAILPOET-2382]
This commit is contained in:
committed by
Jack Kitterhing
parent
70a89b7939
commit
d7d747b945
@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\API\JSON\v1;
|
namespace MailPoet\API\JSON\v1;
|
||||||
|
|
||||||
use MailPoet\API\JSON\Endpoint as APIEndpoint;
|
use MailPoet\API\JSON\Endpoint as APIEndpoint;
|
||||||
use MailPoet\API\JSON\Error;
|
use MailPoet\API\JSON\Error;
|
||||||
use MailPoet\API\JSON\Response;
|
use MailPoet\API\JSON\Response;
|
||||||
use MailPoet\Config\AccessControl;
|
use MailPoet\Config\AccessControl;
|
||||||
|
use MailPoet\DynamicSegments\Exceptions\ErrorSavingException;
|
||||||
|
use MailPoet\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
||||||
|
use MailPoet\DynamicSegments\Mappers\DBMapper;
|
||||||
|
use MailPoet\DynamicSegments\Mappers\FormDataMapper;
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Loading\SubscribersCount;
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Saver;
|
||||||
use MailPoet\Listing\BulkActionController;
|
use MailPoet\Listing\BulkActionController;
|
||||||
use MailPoet\Listing\Handler;
|
use MailPoet\Listing\Handler;
|
||||||
use MailPoet\Models\Model;
|
use MailPoet\Models\Model;
|
||||||
use MailPoet\Premium\DynamicSegments\Exceptions\ErrorSavingException;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Mappers\DBMapper;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Mappers\FormDataMapper;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersCount;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Saver;
|
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
class DynamicSegments extends APIEndpoint {
|
class DynamicSegments extends APIEndpoint {
|
||||||
@ -56,7 +56,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
$id = (int)$data['id'];
|
$id = (int)$data['id'];
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet-premium'),
|
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
], $filters[0]->toArray()));
|
], $filters[0]->toArray()));
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet-premium'),
|
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,21 +99,21 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
private function getErrorString(InvalidSegmentTypeException $e) {
|
private function getErrorString(InvalidSegmentTypeException $e) {
|
||||||
switch ($e->getCode()) {
|
switch ($e->getCode()) {
|
||||||
case InvalidSegmentTypeException::MISSING_TYPE:
|
case InvalidSegmentTypeException::MISSING_TYPE:
|
||||||
return WPFunctions::get()->__('Segment type is missing.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Segment type is missing.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::INVALID_TYPE:
|
case InvalidSegmentTypeException::INVALID_TYPE:
|
||||||
return WPFunctions::get()->__('Segment type is unknown.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Segment type is unknown.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::MISSING_ROLE:
|
case InvalidSegmentTypeException::MISSING_ROLE:
|
||||||
return WPFunctions::get()->__('Please select user role.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Please select user role.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::MISSING_ACTION:
|
case InvalidSegmentTypeException::MISSING_ACTION:
|
||||||
return WPFunctions::get()->__('Please select email action.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Please select email action.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::MISSING_NEWSLETTER_ID:
|
case InvalidSegmentTypeException::MISSING_NEWSLETTER_ID:
|
||||||
return WPFunctions::get()->__('Please select an email.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Please select an email.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::MISSING_PRODUCT_ID:
|
case InvalidSegmentTypeException::MISSING_PRODUCT_ID:
|
||||||
return WPFunctions::get()->__('Please select category.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Please select category.', 'mailpoet');
|
||||||
case InvalidSegmentTypeException::MISSING_CATEGORY_ID:
|
case InvalidSegmentTypeException::MISSING_CATEGORY_ID:
|
||||||
return WPFunctions::get()->__('Please select product.', 'mailpoet-premium');
|
return WPFunctions::get()->__('Please select product.', 'mailpoet');
|
||||||
default:
|
default:
|
||||||
return WPFunctions::get()->__('An error occurred while saving data.', 'mailpoet-premium');
|
return WPFunctions::get()->__('An error occurred while saving data.', 'mailpoet');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
$id = (int)$data['id'];
|
$id = (int)$data['id'];
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet-premium'),
|
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
);
|
);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet-premium'),
|
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
$id = (int)$data['id'];
|
$id = (int)$data['id'];
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet-premium'),
|
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
);
|
);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet-premium'),
|
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
$id = (int)$data['id'];
|
$id = (int)$data['id'];
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet-premium'),
|
Error::BAD_REQUEST => WPFunctions::get()->__('Missing mandatory argument `id`.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,13 +178,13 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
return $this->successResponse(null, ['count' => 1]);
|
return $this->successResponse(null, ['count' => 1]);
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (\InvalidArgumentException $e) {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet-premium'),
|
Error::NOT_FOUND => WPFunctions::get()->__('This segment does not exist.', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function listing($data = []) {
|
function listing($data = []) {
|
||||||
$listing_data = $this->listing_handler->get('\MailPoet\Premium\Models\DynamicSegment', $data);
|
$listing_data = $this->listing_handler->get('\MailPoet\Models\DynamicSegment', $data);
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($listing_data['items'] as $segment) {
|
foreach ($listing_data['items'] as $segment) {
|
||||||
@ -208,7 +208,7 @@ class DynamicSegments extends APIEndpoint {
|
|||||||
|
|
||||||
function bulkAction($data = []) {
|
function bulkAction($data = []) {
|
||||||
try {
|
try {
|
||||||
$meta = $this->bulk_action->apply('\MailPoet\Premium\Models\DynamicSegment', $data);
|
$meta = $this->bulk_action->apply('\MailPoet\Models\DynamicSegment', $data);
|
||||||
return $this->successResponse(null, $meta);
|
return $this->successResponse(null, $meta);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->errorResponse([
|
return $this->errorResponse([
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\API\JSON\v1;
|
namespace MailPoet\API\JSON\v1;
|
||||||
|
|
||||||
use MailPoet\API\JSON\Endpoint as APIEndpoint;
|
use MailPoet\API\JSON\Endpoint as APIEndpoint;
|
||||||
use MailPoet\Config\AccessControl;
|
use MailPoet\Config\AccessControl;
|
||||||
@ -17,4 +17,4 @@ class NewsletterLinks extends APIEndpoint {
|
|||||||
return $this->successResponse($links);
|
return $this->successResponse($links);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Exceptions;
|
namespace MailPoet\DynamicSegments\Exceptions;
|
||||||
|
|
||||||
class ErrorSavingException extends \Exception {
|
class ErrorSavingException extends \Exception {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Exceptions;
|
namespace MailPoet\DynamicSegments\Exceptions;
|
||||||
|
|
||||||
class InvalidSegmentTypeException extends \Exception {
|
class InvalidSegmentTypeException extends \Exception {
|
||||||
|
|
||||||
@ -12,4 +12,4 @@ class InvalidSegmentTypeException extends \Exception {
|
|||||||
const MISSING_CATEGORY_ID = 6;
|
const MISSING_CATEGORY_ID = 6;
|
||||||
const MISSING_PRODUCT_ID = 7;
|
const MISSING_PRODUCT_ID = 7;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Filters;
|
namespace MailPoet\DynamicSegments\Filters;
|
||||||
|
|
||||||
use MailPoet\Models\StatisticsClicks;
|
use MailPoet\Models\StatisticsClicks;
|
||||||
use MailPoet\Models\StatisticsNewsletters;
|
use MailPoet\Models\StatisticsNewsletters;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Filters;
|
namespace MailPoet\DynamicSegments\Filters;
|
||||||
|
|
||||||
interface Filter {
|
interface Filter {
|
||||||
|
|
||||||
@ -8,4 +8,4 @@ interface Filter {
|
|||||||
|
|
||||||
function toArray();
|
function toArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Filters;
|
namespace MailPoet\DynamicSegments\Filters;
|
||||||
|
|
||||||
class UserRole implements Filter {
|
class UserRole implements Filter {
|
||||||
|
|
||||||
@ -41,4 +41,4 @@ class UserRole implements Filter {
|
|||||||
function getRole() {
|
function getRole() {
|
||||||
return $this->role;
|
return $this->role;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Filters;
|
namespace MailPoet\DynamicSegments\Filters;
|
||||||
|
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Filters;
|
namespace MailPoet\DynamicSegments\Filters;
|
||||||
|
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
|
|
||||||
@ -53,4 +53,4 @@ class WooCommerceProduct implements Filter {
|
|||||||
'segmentType' => WooCommerceProduct::SEGMENT_TYPE,
|
'segmentType' => WooCommerceProduct::SEGMENT_TYPE,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\FreePluginConnectors;
|
namespace MailPoet\DynamicSegments\FreePluginConnectors;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\Loader;
|
use MailPoet\DynamicSegments\Persistence\Loading\Loader;
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersCount;
|
use MailPoet\DynamicSegments\Persistence\Loading\SubscribersCount;
|
||||||
|
|
||||||
class AddToNewslettersSegments {
|
class AddToNewslettersSegments {
|
||||||
|
|
||||||
/** @var Loader */
|
/** @var Loader */
|
||||||
private $loader;
|
private $loader;
|
||||||
|
|
||||||
/** @var \MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersCount */
|
/** @var SubscribersCount */
|
||||||
private $subscribersCountLoader;
|
private $subscribersCountLoader;
|
||||||
|
|
||||||
public function __construct(Loader $loader, SubscribersCount $subscribersCountLoader) {
|
public function __construct(Loader $loader, SubscribersCount $subscribersCountLoader) {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\FreePluginConnectors;
|
namespace MailPoet\DynamicSegments\FreePluginConnectors;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\Loader;
|
use MailPoet\DynamicSegments\Persistence\Loading\Loader;
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersCount;
|
use MailPoet\DynamicSegments\Persistence\Loading\SubscribersCount;
|
||||||
|
|
||||||
class AddToSubscribersFilters {
|
class AddToSubscribersFilters {
|
||||||
|
|
||||||
/** @var \MailPoet\Premium\DynamicSegments\Persistence\Loading\Loader */
|
/** @var Loader */
|
||||||
private $loader;
|
private $loader;
|
||||||
|
|
||||||
/** @var SubscribersCount */
|
/** @var SubscribersCount */
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\FreePluginConnectors;
|
namespace MailPoet\DynamicSegments\FreePluginConnectors;
|
||||||
|
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Loading\SubscribersIds;
|
||||||
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersIds;
|
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
|
||||||
|
|
||||||
class SendingNewslettersSubscribersFinder {
|
class SendingNewslettersSubscribersFinder {
|
||||||
|
|
||||||
/** @var SingleSegmentLoader */
|
/** @var SingleSegmentLoader */
|
||||||
private $single_segment_loader;
|
private $single_segment_loader;
|
||||||
|
|
||||||
/** @var \MailPoet\Premium\DynamicSegments\Persistence\Loading\SubscribersIds */
|
/** @var SubscribersIds */
|
||||||
private $subscribers_ids_loader;
|
private $subscribers_ids_loader;
|
||||||
|
|
||||||
public function __construct(SingleSegmentLoader $single_segment_loader, SubscribersIds $subscribers_ids_loader) {
|
public function __construct(SingleSegmentLoader $single_segment_loader, SubscribersIds $subscribers_ids_loader) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\FreePluginConnectors;
|
namespace MailPoet\DynamicSegments\FreePluginConnectors;
|
||||||
|
|
||||||
use MailPoet\Listing\BulkActionController;
|
use MailPoet\Listing\BulkActionController;
|
||||||
use MailPoet\Listing\BulkActionFactory;
|
use MailPoet\Listing\BulkActionFactory;
|
||||||
use MailPoet\Listing\Handler;
|
use MailPoet\Listing\Handler;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
use MailPoet\Models\DynamicSegment;
|
||||||
|
|
||||||
class SubscribersBulkActionHandler {
|
class SubscribersBulkActionHandler {
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ class SubscribersBulkActionHandler {
|
|||||||
function apply(array $segment, array $data) {
|
function apply(array $segment, array $data) {
|
||||||
if ($segment['type'] === DynamicSegment::TYPE_DYNAMIC) {
|
if ($segment['type'] === DynamicSegment::TYPE_DYNAMIC) {
|
||||||
$bulkAction = new BulkActionController(new BulkActionFactory(), new Handler());
|
$bulkAction = new BulkActionController(new BulkActionFactory(), new Handler());
|
||||||
return $bulkAction->apply('\MailPoet\Premium\Models\SubscribersInDynamicSegment', $data);
|
return $bulkAction->apply('\MailPoet\Models\SubscribersInDynamicSegment', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\FreePluginConnectors;
|
namespace MailPoet\DynamicSegments\FreePluginConnectors;
|
||||||
|
|
||||||
use MailPoet\Listing\Handler;
|
use MailPoet\Listing\Handler;
|
||||||
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
|
||||||
|
|
||||||
class SubscribersListingsHandlerFactory {
|
class SubscribersListingsHandlerFactory {
|
||||||
|
|
||||||
function get(Segment $segment, $data) {
|
function get(Segment $segment, $data) {
|
||||||
if ($segment->type === DynamicSegment::TYPE_DYNAMIC) {
|
if ($segment->type === DynamicSegment::TYPE_DYNAMIC) {
|
||||||
$listing = new Handler();
|
$listing = new Handler();
|
||||||
return $listing_data = $listing->get('\MailPoet\Premium\Models\SubscribersInDynamicSegment', $data);
|
return $listing_data = $listing->get('\MailPoet\Models\SubscribersInDynamicSegment', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Mappers;
|
namespace MailPoet\DynamicSegments\Mappers;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
use MailPoet\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\EmailAction;
|
use MailPoet\DynamicSegments\Filters\EmailAction;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\Filter;
|
use MailPoet\DynamicSegments\Filters\Filter;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\UserRole;
|
use MailPoet\DynamicSegments\Filters\UserRole;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\WooCommerceCategory;
|
use MailPoet\DynamicSegments\Filters\WooCommerceCategory;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\WooCommerceProduct;
|
use MailPoet\DynamicSegments\Filters\WooCommerceProduct;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Premium\Models\DynamicSegmentFilter;
|
use MailPoet\Models\DynamicSegmentFilter;
|
||||||
|
|
||||||
class DBMapper {
|
class DBMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \MailPoet\Premium\Models\DynamicSegment $segment_data
|
* @param DynamicSegment $segment_data
|
||||||
* @param DynamicSegmentFilter[] $filters_data
|
* @param DynamicSegmentFilter[] $filters_data
|
||||||
*
|
*
|
||||||
* @return DynamicSegment
|
* @return DynamicSegment
|
||||||
@ -26,7 +26,7 @@ class DBMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \MailPoet\Premium\Models\DynamicSegment[] $segments_data
|
* @param DynamicSegment[] $segments_data
|
||||||
* @param DynamicSegmentFilter[] $filters_data
|
* @param DynamicSegmentFilter[] $filters_data
|
||||||
*
|
*
|
||||||
* @return DynamicSegment[]
|
* @return DynamicSegment[]
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Mappers;
|
namespace MailPoet\DynamicSegments\Mappers;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
use MailPoet\DynamicSegments\Exceptions\InvalidSegmentTypeException;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\EmailAction;
|
use MailPoet\DynamicSegments\Filters\EmailAction;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\Filter;
|
use MailPoet\DynamicSegments\Filters\Filter;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\UserRole;
|
use MailPoet\DynamicSegments\Filters\UserRole;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\WooCommerceCategory;
|
use MailPoet\DynamicSegments\Filters\WooCommerceCategory;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\WooCommerceProduct;
|
use MailPoet\DynamicSegments\Filters\WooCommerceProduct;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
use MailPoet\Models\DynamicSegment;
|
||||||
|
|
||||||
class FormDataMapper {
|
class FormDataMapper {
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Persistence\Loading;
|
namespace MailPoet\DynamicSegments\Persistence\Loading;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Mappers\DBMapper;
|
use MailPoet\DynamicSegments\Mappers\DBMapper;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Premium\Models\DynamicSegmentFilter;
|
use MailPoet\Models\DynamicSegmentFilter;
|
||||||
|
|
||||||
class Loader {
|
class Loader {
|
||||||
|
|
||||||
@ -32,4 +32,4 @@ class Loader {
|
|||||||
return $this->mapper->mapSegments($segments, $filters);
|
return $this->mapper->mapSegments($segments, $filters);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Persistence\Loading;
|
namespace MailPoet\DynamicSegments\Persistence\Loading;
|
||||||
|
|
||||||
use MailPoet\Premium\DynamicSegments\Mappers\DBMapper;
|
use MailPoet\DynamicSegments\Mappers\DBMapper;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
use MailPoet\Models\DynamicSegment;
|
||||||
|
|
||||||
class SingleSegmentLoader {
|
class SingleSegmentLoader {
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Persistence\Loading;
|
namespace MailPoet\DynamicSegments\Persistence\Loading;
|
||||||
|
|
||||||
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
|
||||||
|
|
||||||
class SubscribersCount {
|
class SubscribersCount {
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Persistence\Loading;
|
namespace MailPoet\DynamicSegments\Persistence\Loading;
|
||||||
|
|
||||||
|
use MailPoet\Models\DynamicSegment;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
|
||||||
|
|
||||||
class SubscribersIds {
|
class SubscribersIds {
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\DynamicSegments\Persistence;
|
namespace MailPoet\DynamicSegments\Persistence;
|
||||||
|
|
||||||
|
use MailPoet\DynamicSegments\Exceptions\ErrorSavingException;
|
||||||
|
use MailPoet\DynamicSegments\Filters\Filter;
|
||||||
|
use MailPoet\Models\DynamicSegment;
|
||||||
|
use MailPoet\Models\DynamicSegmentFilter;
|
||||||
use MailPoet\Models\Model;
|
use MailPoet\Models\Model;
|
||||||
use MailPoet\Premium\DynamicSegments\Exceptions\ErrorSavingException;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\Filter;
|
|
||||||
use MailPoet\Premium\Models\DynamicSegment;
|
|
||||||
use MailPoet\Premium\Models\DynamicSegmentFilter;
|
|
||||||
|
|
||||||
class Saver {
|
class Saver {
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
use MailPoet\DynamicSegments\Filters\Filter;
|
||||||
use MailPoet\Models\Segment as MailPoetSegment;
|
use MailPoet\Models\Segment as MailPoetSegment;
|
||||||
use MailPoet\Premium\DynamicSegments\Filters\Filter;
|
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,12 +66,12 @@ class DynamicSegment extends MailPoetSegment {
|
|||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
'name' => 'all',
|
'name' => 'all',
|
||||||
'label' => WPFunctions::get()->__('All', 'mailpoet-premium'),
|
'label' => WPFunctions::get()->__('All', 'mailpoet'),
|
||||||
'count' => DynamicSegment::getPublished()->where('type', DynamicSegment::TYPE_DYNAMIC)->count(),
|
'count' => DynamicSegment::getPublished()->where('type', DynamicSegment::TYPE_DYNAMIC)->count(),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'trash',
|
'name' => 'trash',
|
||||||
'label' => WPFunctions::get()->__('Trash', 'mailpoet-premium'),
|
'label' => WPFunctions::get()->__('Trash', 'mailpoet'),
|
||||||
'count' => parent::getTrashed()->where('type', DynamicSegment::TYPE_DYNAMIC)->count(),
|
'count' => parent::getTrashed()->where('type', DynamicSegment::TYPE_DYNAMIC)->count(),
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
use MailPoet\Models\Model;
|
use MailPoet\Models\Model;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace MailPoet\Premium\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
use MailPoet\DynamicSegments\Mappers\DBMapper;
|
||||||
|
use MailPoet\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Premium\DynamicSegments\Mappers\DBMapper;
|
|
||||||
use MailPoet\Premium\DynamicSegments\Persistence\Loading\SingleSegmentLoader;
|
|
||||||
|
|
||||||
class SubscribersInDynamicSegment extends Subscriber {
|
class SubscribersInDynamicSegment extends Subscriber {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user