Replace deprecated doctrine methods in lib directory

[MAILPOET-3889]
This commit is contained in:
Rostislav Wolny
2021-10-27 10:16:54 +02:00
committed by Veljko V
parent efde80b5c4
commit 73a9bed483
11 changed files with 35 additions and 35 deletions

View File

@@ -716,7 +716,7 @@ class Populator {
t.status = :tStatusScheduled t.status = :tStatusScheduled
AND n.status = :nStatusDraft AND n.status = :nStatusDraft
"; ";
$this->entityManager->getConnection()->executeUpdate( $this->entityManager->getConnection()->executeStatement(
$query, $query,
[ [
'tStatusPaused' => ScheduledTaskEntity::STATUS_PAUSED, 'tStatusPaused' => ScheduledTaskEntity::STATUS_PAUSED,

View File

@@ -59,7 +59,7 @@ class StatsNotificationsRepository extends Repository {
public function deleteOrphanedScheduledTasks() { public function deleteOrphanedScheduledTasks() {
$scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName(); $scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName();
$statsNotificationsTable = $this->entityManager->getClassMetadata(StatsNotificationEntity::class)->getTableName(); $statsNotificationsTable = $this->entityManager->getClassMetadata(StatsNotificationEntity::class)->getTableName();
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
DELETE st FROM $scheduledTasksTable st DELETE st FROM $scheduledTasksTable st
LEFT JOIN $statsNotificationsTable sn ON sn.task_id = st.id LEFT JOIN $statsNotificationsTable sn ON sn.task_id = st.id
WHERE sn.id IS NULL AND st.type = :taskType; WHERE sn.id IS NULL AND st.type = :taskType;

View File

@@ -79,10 +79,10 @@ abstract class Repository {
public function truncate() { public function truncate() {
$tableName = $this->classMetadata->getTableName(); $tableName = $this->classMetadata->getTableName();
$connection = $this->entityManager->getConnection(); $connection = $this->entityManager->getConnection();
$connection->query('SET FOREIGN_KEY_CHECKS=0'); $connection->executeQuery('SET FOREIGN_KEY_CHECKS=0');
$q = "TRUNCATE $tableName"; $q = "TRUNCATE $tableName";
$connection->executeUpdate($q); $connection->executeStatement($q);
$connection->query('SET FOREIGN_KEY_CHECKS=1'); $connection->executeQuery('SET FOREIGN_KEY_CHECKS=1');
} }
/** /**

View File

@@ -187,7 +187,7 @@ class NewslettersRepository extends Repository {
// Trash scheduled tasks // Trash scheduled tasks
$scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName(); $scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName();
$sendingQueueTable = $this->entityManager->getClassMetadata(SendingQueueEntity::class)->getTableName(); $sendingQueueTable = $this->entityManager->getClassMetadata(SendingQueueEntity::class)->getTableName();
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
UPDATE $scheduledTasksTable t UPDATE $scheduledTasksTable t
JOIN $sendingQueueTable q ON t.`id` = q.`task_id` JOIN $sendingQueueTable q ON t.`id` = q.`task_id`
SET t.`deleted_at` = NOW() SET t.`deleted_at` = NOW()
@@ -195,7 +195,7 @@ class NewslettersRepository extends Repository {
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Trash sending queues // Trash sending queues
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
UPDATE $sendingQueueTable q UPDATE $sendingQueueTable q
SET q.`deleted_at` = NOW() SET q.`deleted_at` = NOW()
WHERE q.`newsletter_id` IN (:ids) WHERE q.`newsletter_id` IN (:ids)
@@ -222,7 +222,7 @@ class NewslettersRepository extends Repository {
// Restore scheduled tasks and pause running ones // Restore scheduled tasks and pause running ones
$scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName(); $scheduledTasksTable = $this->entityManager->getClassMetadata(ScheduledTaskEntity::class)->getTableName();
$sendingQueueTable = $this->entityManager->getClassMetadata(SendingQueueEntity::class)->getTableName(); $sendingQueueTable = $this->entityManager->getClassMetadata(SendingQueueEntity::class)->getTableName();
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
UPDATE $scheduledTasksTable t UPDATE $scheduledTasksTable t
JOIN $sendingQueueTable q ON t.`id` = q.`task_id` JOIN $sendingQueueTable q ON t.`id` = q.`task_id`
SET t.`deleted_at` = null, t.`status` = IFNULL(t.status, :pausedStatus) SET t.`deleted_at` = null, t.`status` = IFNULL(t.status, :pausedStatus)
@@ -235,7 +235,7 @@ class NewslettersRepository extends Repository {
]); ]);
// Restore sending queues // Restore sending queues
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
UPDATE $sendingQueueTable q UPDATE $sendingQueueTable q
SET q.`deleted_at` = null SET q.`deleted_at` = null
WHERE q.`newsletter_id` IN (:ids) WHERE q.`newsletter_id` IN (:ids)
@@ -255,46 +255,46 @@ class NewslettersRepository extends Repository {
$this->entityManager->transactional(function (EntityManager $entityManager) use ($ids) { $this->entityManager->transactional(function (EntityManager $entityManager) use ($ids) {
// Delete statistics data // Delete statistics data
$newsletterStatisticsTable = $entityManager->getClassMetadata(StatisticsNewsletterEntity::class)->getTableName(); $newsletterStatisticsTable = $entityManager->getClassMetadata(StatisticsNewsletterEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE s FROM $newsletterStatisticsTable s DELETE s FROM $newsletterStatisticsTable s
WHERE s.`newsletter_id` IN (:ids) WHERE s.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
$statisticsOpensTable = $entityManager->getClassMetadata(StatisticsOpenEntity::class)->getTableName(); $statisticsOpensTable = $entityManager->getClassMetadata(StatisticsOpenEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE s FROM $statisticsOpensTable s DELETE s FROM $statisticsOpensTable s
WHERE s.`newsletter_id` IN (:ids) WHERE s.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
$statisticsClicksTable = $entityManager->getClassMetadata(StatisticsClickEntity::class)->getTableName(); $statisticsClicksTable = $entityManager->getClassMetadata(StatisticsClickEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE s FROM $statisticsClicksTable s DELETE s FROM $statisticsClicksTable s
WHERE s.`newsletter_id` IN (:ids) WHERE s.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
$statisticsPurchasesTable = $entityManager->getClassMetadata(StatisticsWooCommercePurchaseEntity::class)->getTableName(); $statisticsPurchasesTable = $entityManager->getClassMetadata(StatisticsWooCommercePurchaseEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE s FROM $statisticsPurchasesTable s DELETE s FROM $statisticsPurchasesTable s
WHERE s.`newsletter_id` IN (:ids) WHERE s.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete newsletter posts // Delete newsletter posts
$postsTable = $entityManager->getClassMetadata(NewsletterPostEntity::class)->getTableName(); $postsTable = $entityManager->getClassMetadata(NewsletterPostEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE np FROM $postsTable np DELETE np FROM $postsTable np
WHERE np.`newsletter_id` IN (:ids) WHERE np.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete newsletter options // Delete newsletter options
$optionsTable = $entityManager->getClassMetadata(NewsletterOptionEntity::class)->getTableName(); $optionsTable = $entityManager->getClassMetadata(NewsletterOptionEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE no FROM $optionsTable no DELETE no FROM $optionsTable no
WHERE no.`newsletter_id` IN (:ids) WHERE no.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete newsletter links // Delete newsletter links
$linksTable = $entityManager->getClassMetadata(NewsletterLinkEntity::class)->getTableName(); $linksTable = $entityManager->getClassMetadata(NewsletterLinkEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE nl FROM $linksTable nl DELETE nl FROM $linksTable nl
WHERE nl.`newsletter_id` IN (:ids) WHERE nl.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
@@ -305,15 +305,15 @@ class NewslettersRepository extends Repository {
$taskIds = $entityManager->getConnection()->executeQuery(" $taskIds = $entityManager->getConnection()->executeQuery("
SELECT task_id FROM $statsNotificationsTable sn SELECT task_id FROM $statsNotificationsTable sn
WHERE sn.`newsletter_id` IN (:ids) WHERE sn.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY])->fetchAll(); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY])->fetchAllAssociative();
$taskIds = array_column($taskIds, 'task_id'); $taskIds = array_column($taskIds, 'task_id');
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE st FROM $scheduledTasksTable st DELETE st FROM $scheduledTasksTable st
WHERE st.`id` IN (:ids) WHERE st.`id` IN (:ids)
", ['ids' => $taskIds], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $taskIds], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete stats notifications // Delete stats notifications
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE sn FROM $statsNotificationsTable sn DELETE sn FROM $statsNotificationsTable sn
WHERE sn.`newsletter_id` IN (:ids) WHERE sn.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
@@ -323,28 +323,28 @@ class NewslettersRepository extends Repository {
$scheduledTaskSubscribersTable = $entityManager->getClassMetadata(ScheduledTaskSubscriberEntity::class)->getTableName(); $scheduledTaskSubscribersTable = $entityManager->getClassMetadata(ScheduledTaskSubscriberEntity::class)->getTableName();
// Delete scheduled tasks subscribers // Delete scheduled tasks subscribers
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE ts FROM $scheduledTaskSubscribersTable ts DELETE ts FROM $scheduledTaskSubscribersTable ts
JOIN $scheduledTasksTable t ON t.`id` = ts.`task_id` JOIN $scheduledTasksTable t ON t.`id` = ts.`task_id`
JOIN $sendingQueueTable q ON q.`task_id` = t.`id` JOIN $sendingQueueTable q ON q.`task_id` = t.`id`
WHERE q.`newsletter_id` IN (:ids) WHERE q.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE t FROM $scheduledTasksTable t DELETE t FROM $scheduledTasksTable t
JOIN $sendingQueueTable q ON t.`id` = q.`task_id` JOIN $sendingQueueTable q ON t.`id` = q.`task_id`
WHERE q.`newsletter_id` IN (:ids) WHERE q.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete sending queues // Delete sending queues
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE q FROM $sendingQueueTable q DELETE q FROM $sendingQueueTable q
WHERE q.`newsletter_id` IN (:ids) WHERE q.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);
// Delete newsletter segments // Delete newsletter segments
$newsletterSegmentsTable = $entityManager->getClassMetadata(NewsletterSegmentEntity::class)->getTableName(); $newsletterSegmentsTable = $entityManager->getClassMetadata(NewsletterSegmentEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE ns FROM $newsletterSegmentsTable ns DELETE ns FROM $newsletterSegmentsTable ns
WHERE ns.`newsletter_id` IN (:ids) WHERE ns.`newsletter_id` IN (:ids)
", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]); ", ['ids' => $ids], ['ids' => Connection::PARAM_INT_ARRAY]);

View File

@@ -50,7 +50,7 @@ class SegmentSaveController {
FROM $subscriberSegmentTable FROM $subscriberSegmentTable
WHERE segment_id = :segmentId WHERE segment_id = :segmentId
"); ");
$stmt->execute([ $stmt->executeQuery([
'duplicateId' => $duplicate->getId(), 'duplicateId' => $duplicate->getId(),
'segmentId' => $segmentEntity->getId(), 'segmentId' => $segmentEntity->getId(),
]); ]);

View File

@@ -324,7 +324,7 @@ class SegmentSubscribersRepository {
$queryBuilder $queryBuilder
->leftJoin('s', $subscribersSegmentTable, 'ssg', ->leftJoin('s', $subscribersSegmentTable, 'ssg',
(string)$queryBuilder->expr()->andX( (string)$queryBuilder->expr()->and(
$queryBuilder->expr()->eq('ssg.subscriber_id', 's.id'), $queryBuilder->expr()->eq('ssg.subscriber_id', 's.id'),
$queryBuilder->expr()->eq('ssg.status', ':statusSubscribed'), $queryBuilder->expr()->eq('ssg.status', ':statusSubscribed'),
$queryBuilder->expr()->notIn('ssg.segment_id', $deletedSegmentsQueryBuilder->getQuery()->getSQL()) $queryBuilder->expr()->notIn('ssg.segment_id', $deletedSegmentsQueryBuilder->getQuery()->getSQL())

View File

@@ -148,7 +148,7 @@ class SegmentsRepository extends Repository {
$segmentTable = $entityManager->getClassMetadata(SegmentEntity::class)->getTableName(); $segmentTable = $entityManager->getClassMetadata(SegmentEntity::class)->getTableName();
$segmentFiltersTable = $entityManager->getClassMetadata(DynamicSegmentFilterEntity::class)->getTableName(); $segmentFiltersTable = $entityManager->getClassMetadata(DynamicSegmentFilterEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE ss FROM $subscriberSegmentTable ss DELETE ss FROM $subscriberSegmentTable ss
JOIN $segmentTable s ON ss.`segment_id` = s.`id` JOIN $segmentTable s ON ss.`segment_id` = s.`id`
WHERE ss.`segment_id` IN (:ids) WHERE ss.`segment_id` IN (:ids)
@@ -158,14 +158,14 @@ class SegmentsRepository extends Repository {
'type' => $type, 'type' => $type,
], ['ids' => Connection::PARAM_INT_ARRAY]); ], ['ids' => Connection::PARAM_INT_ARRAY]);
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE df FROM $segmentFiltersTable df DELETE df FROM $segmentFiltersTable df
WHERE df.`segment_id` IN (:ids) WHERE df.`segment_id` IN (:ids)
", [ ", [
'ids' => $ids, 'ids' => $ids,
], ['ids' => Connection::PARAM_INT_ARRAY]); ], ['ids' => Connection::PARAM_INT_ARRAY]);
return $entityManager->getConnection()->executeUpdate(" return $entityManager->getConnection()->executeStatement("
DELETE s FROM $segmentTable s DELETE s FROM $segmentTable s
WHERE s.`id` IN (:ids) WHERE s.`id` IN (:ids)
AND s.`type` = :type AND s.`type` = :type

View File

@@ -21,7 +21,7 @@ class SettingsRepository extends Repository {
// by a code solving atomicity of create-or-update on entity (ORM) level in a follow-up ticket. // by a code solving atomicity of create-or-update on entity (ORM) level in a follow-up ticket.
$now = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp')); $now = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp'));
$tableName = $this->entityManager->getClassMetadata(SettingEntity::class)->getTableName(); $tableName = $this->entityManager->getClassMetadata(SettingEntity::class)->getTableName();
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
INSERT INTO $tableName (name, value, created_at, updated_at) INSERT INTO $tableName (name, value, created_at, updated_at)
VALUES (:name, :value, :now, :now) VALUES (:name, :value, :now, :now)
ON DUPLICATE KEY UPDATE value = :value, updated_at = :now ON DUPLICATE KEY UPDATE value = :value, updated_at = :now

View File

@@ -96,7 +96,7 @@ class ImportExportRepository {
$rows[] = "(" . implode(', ', $paramNames) . ")"; $rows[] = "(" . implode(', ', $paramNames) . ")";
} }
return $this->entityManager->getConnection()->executeUpdate(" return $this->entityManager->getConnection()->executeStatement("
INSERT IGNORE INTO {$tableName} (`" . implode("`, `", $columns) . "`) VALUES INSERT IGNORE INTO {$tableName} (`" . implode("`, `", $columns) . "`) VALUES
" . implode(", \n", $rows) . " " . implode(", \n", $rows) . "
", $parameters); ", $parameters);
@@ -156,7 +156,7 @@ class ImportExportRepository {
$updateColumns[] = 'deleted_at = NULL'; $updateColumns[] = 'deleted_at = NULL';
} }
return $this->entityManager->getConnection()->executeUpdate(" return $this->entityManager->getConnection()->executeStatement("
UPDATE {$tableName} SET UPDATE {$tableName} SET
" . implode(", \n", $updateColumns) . " " . implode(", \n", $updateColumns) . "
WHERE WHERE

View File

@@ -50,7 +50,7 @@ class SubscriberSegmentRepository extends Repository {
} else { } else {
$subscriberSegmentTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName(); $subscriberSegmentTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName();
$segmentTable = $this->entityManager->getClassMetadata(SegmentEntity::class)->getTableName(); $segmentTable = $this->entityManager->getClassMetadata(SegmentEntity::class)->getTableName();
$this->entityManager->getConnection()->executeUpdate(" $this->entityManager->getConnection()->executeStatement("
UPDATE $subscriberSegmentTable ss UPDATE $subscriberSegmentTable ss
JOIN $segmentTable s ON s.`id` = ss.`segment_id` AND ss.`subscriber_id` = :subscriberId JOIN $segmentTable s ON s.`id` = ss.`segment_id` AND ss.`subscriber_id` = :subscriberId
SET ss.`status` = :status SET ss.`status` = :status

View File

@@ -136,7 +136,7 @@ class SubscribersRepository extends Repository {
// Delete subscriber custom fields // Delete subscriber custom fields
$subscriberCustomFieldTable = $entityManager->getClassMetadata(SubscriberCustomFieldEntity::class)->getTableName(); $subscriberCustomFieldTable = $entityManager->getClassMetadata(SubscriberCustomFieldEntity::class)->getTableName();
$subscriberTable = $entityManager->getClassMetadata(SubscriberEntity::class)->getTableName(); $subscriberTable = $entityManager->getClassMetadata(SubscriberEntity::class)->getTableName();
$entityManager->getConnection()->executeUpdate(" $entityManager->getConnection()->executeStatement("
DELETE scs FROM $subscriberCustomFieldTable scs DELETE scs FROM $subscriberCustomFieldTable scs
JOIN $subscriberTable s ON s.`id` = scs.`subscriber_id` JOIN $subscriberTable s ON s.`id` = scs.`subscriber_id`
WHERE scs.`subscriber_id` IN (:ids) WHERE scs.`subscriber_id` IN (:ids)
@@ -165,7 +165,7 @@ class SubscribersRepository extends Repository {
} }
$subscriberSegmentsTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName(); $subscriberSegmentsTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName();
$count = $this->entityManager->getConnection()->executeUpdate(" $count = $this->entityManager->getConnection()->executeStatement("
DELETE ss FROM $subscriberSegmentsTable ss DELETE ss FROM $subscriberSegmentsTable ss
WHERE ss.`subscriber_id` IN (:ids) WHERE ss.`subscriber_id` IN (:ids)
AND ss.`segment_id` = :segment_id AND ss.`segment_id` = :segment_id
@@ -184,7 +184,7 @@ class SubscribersRepository extends Repository {
$subscriberSegmentsTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName(); $subscriberSegmentsTable = $this->entityManager->getClassMetadata(SubscriberSegmentEntity::class)->getTableName();
$segmentsTable = $this->entityManager->getClassMetadata(SegmentEntity::class)->getTableName(); $segmentsTable = $this->entityManager->getClassMetadata(SegmentEntity::class)->getTableName();
$count = $this->entityManager->getConnection()->executeUpdate(" $count = $this->entityManager->getConnection()->executeStatement("
DELETE ss FROM $subscriberSegmentsTable ss DELETE ss FROM $subscriberSegmentsTable ss
JOIN $segmentsTable s ON s.id = ss.segment_id AND s.`type` = :typeDefault JOIN $segmentsTable s ON s.id = ss.segment_id AND s.`type` = :typeDefault
WHERE ss.`subscriber_id` IN (:ids) WHERE ss.`subscriber_id` IN (:ids)