Remove deprecations
Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
Родитель
bfea423d8d
Коммит
67c746caca
|
@ -82,7 +82,7 @@ class CommentMapper extends QBMapper {
|
|||
$qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ class CommentMapper extends QBMapper {
|
|||
$qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,6 +107,6 @@ class CommentMapper extends QBMapper {
|
|||
$query->update($this->getTableName())
|
||||
->set('user_id', $query->createNamedParameter($replacementName))
|
||||
->where($query->expr()->eq('user_id', $query->createNamedParameter($userId)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ class LogMapper extends QBMapper {
|
|||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'processed', 'poll_id', 'user_id', 'message_id')
|
||||
->from($this->getTableName());
|
||||
$foundEntries = $query->execute();
|
||||
$foundEntries = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())
|
||||
|
@ -132,7 +132,7 @@ class LogMapper extends QBMapper {
|
|||
];
|
||||
if (in_array($currentRecord, $entries2Keep)) {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$entries2Keep[] = $currentRecord;
|
||||
|
@ -160,7 +160,7 @@ class LogMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('user_id = :userId')
|
||||
->setParameter('userId', $userId);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -172,7 +172,7 @@ class LogMapper extends QBMapper {
|
|||
->where(
|
||||
$query->expr()->lt('created', $query->createNamedParameter($offset))
|
||||
);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,6 +184,6 @@ class LogMapper extends QBMapper {
|
|||
->where(
|
||||
$query->expr()->gt('processed', $query->createNamedParameter(0))
|
||||
);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ class OptionMapper extends QBMapper {
|
|||
$qb->expr()->eq('id', $qb->createNamedParameter($optionId, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function deleteByPoll(int $pollId): void {
|
||||
|
@ -112,7 +112,7 @@ class OptionMapper extends QBMapper {
|
|||
$qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function removeDuplicates(?IOutput $output = null): int {
|
||||
|
@ -123,7 +123,7 @@ class OptionMapper extends QBMapper {
|
|||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'poll_id', 'poll_option_text', 'timestamp')
|
||||
->from($this->getTableName());
|
||||
$foundEntries = $query->execute();
|
||||
$foundEntries = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())
|
||||
|
@ -139,7 +139,7 @@ class OptionMapper extends QBMapper {
|
|||
];
|
||||
if (in_array($currentRecord, $entries2Keep)) {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$entries2Keep[] = $currentRecord;
|
||||
|
@ -183,6 +183,6 @@ class OptionMapper extends QBMapper {
|
|||
$query->update($this->getTableName())
|
||||
->set('owner', $query->createNamedParameter($replacementName))
|
||||
->where($query->expr()->eq('owner', $query->createNamedParameter($userId)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ class PollMapper extends QBMapper {
|
|||
->set('deleted', $query->createNamedParameter($archiveDate))
|
||||
->where($query->expr()->lt('expire', $query->createNamedParameter($offset)))
|
||||
->andWhere($query->expr()->gt('expire', $query->createNamedParameter(0)));
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,6 +170,6 @@ class PollMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('owner = :userId')
|
||||
->setParameter('userId', $userId);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,14 +65,14 @@ class PreferencesMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('user_id = :userId')
|
||||
->setParameter('userId', '');
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
|
||||
// remove duplicate preferences from polls_preferences
|
||||
// preserve the last user setting in the db
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'user_id')
|
||||
->from($this->getTableName());
|
||||
$users = $query->execute();
|
||||
$users = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())
|
||||
|
@ -83,7 +83,7 @@ class PreferencesMapper extends QBMapper {
|
|||
while ($row = $users->fetch()) {
|
||||
if (in_array($row['user_id'], $userskeep)) {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$userskeep[] = $row['user_id'];
|
||||
|
@ -114,6 +114,6 @@ class PreferencesMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('user_id = :userId')
|
||||
->setParameter('userId', $userId);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ class ShareMapper extends QBMapper {
|
|||
$qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function deleteByUserId(string $userId): void {
|
||||
|
@ -137,7 +137,7 @@ class ShareMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('user_id = :userId')
|
||||
->setParameter('userId', $userId);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,7 +150,7 @@ class ShareMapper extends QBMapper {
|
|||
->andWhere('type = :type')
|
||||
->setParameter('id', $id)
|
||||
->setParameter('type', $type);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,7 +164,7 @@ class ShareMapper extends QBMapper {
|
|||
$qb->expr()->eq('id', $qb->createNamedParameter($shareId, IQueryBuilder::PARAM_INT))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function removeDuplicates(?IOutput $output = null): int {
|
||||
|
@ -177,14 +177,14 @@ class ShareMapper extends QBMapper {
|
|||
->set('user_id', 'token')
|
||||
->where('type = :type')
|
||||
->setParameter('type', 'public')
|
||||
->execute();
|
||||
->executeStatement();
|
||||
|
||||
// remove duplicates from polls_share
|
||||
// preserve the first entry
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'type', 'poll_id', 'user_id')
|
||||
->from($this->getTableName());
|
||||
$foundEntries = $query->execute();
|
||||
$foundEntries = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())->where('id = :id');
|
||||
|
@ -200,7 +200,7 @@ class ShareMapper extends QBMapper {
|
|||
|
||||
if (in_array($currentRecord, $entries2Keep) || $row['user_id'] === null || $row['type'] === '') {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$entries2Keep[] = $currentRecord;
|
||||
|
|
|
@ -104,7 +104,7 @@ class SubscriptionMapper extends QBMapper {
|
|||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR))
|
||||
);
|
||||
|
||||
$qb->execute();
|
||||
$qb->executeStatement();
|
||||
}
|
||||
|
||||
public function removeDuplicates(?IOutput $output = null): int {
|
||||
|
@ -115,7 +115,7 @@ class SubscriptionMapper extends QBMapper {
|
|||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'poll_id', 'user_id')
|
||||
->from($this->getTableName());
|
||||
$foundEntries = $query->execute();
|
||||
$foundEntries = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())->where('id = :id');
|
||||
|
@ -130,7 +130,7 @@ class SubscriptionMapper extends QBMapper {
|
|||
|
||||
if (in_array($currentRecord, $entries2Keep)) {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$entries2Keep[] = $currentRecord;
|
||||
|
@ -158,6 +158,6 @@ class SubscriptionMapper extends QBMapper {
|
|||
$query->delete($this->getTableName())
|
||||
->where('user_id = :userId')
|
||||
->setParameter('userId', $userId);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ class VoteMapper extends QBMapper {
|
|||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete($this->getTableName())
|
||||
->where($qb->expr()->eq('id', $qb->createNamedParameter($voteId, IQueryBuilder::PARAM_INT)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
|
||||
public function deleteByPollAndUserId(int $pollId, string $userId): void {
|
||||
|
@ -127,14 +127,14 @@ class VoteMapper extends QBMapper {
|
|||
$qb->delete($this->getTableName())
|
||||
->where($qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
|
||||
public function deleteByPoll(int $pollId): void {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
$qb->delete($this->getTableName())
|
||||
->where($qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -175,7 +175,7 @@ class VoteMapper extends QBMapper {
|
|||
$query = $this->db->getQueryBuilder();
|
||||
$query->select('id', 'poll_id', 'user_id', 'vote_option_text')
|
||||
->from($this->getTableName());
|
||||
$foundEntries = $query->execute();
|
||||
$foundEntries = $query->executeQuery();
|
||||
|
||||
$delete = $this->db->getQueryBuilder();
|
||||
$delete->delete($this->getTableName())
|
||||
|
@ -191,7 +191,7 @@ class VoteMapper extends QBMapper {
|
|||
];
|
||||
if (in_array($currentRecord, $entries2Keep)) {
|
||||
$delete->setParameter('id', $row['id']);
|
||||
$delete->execute();
|
||||
$delete->executeStatement();
|
||||
$count++;
|
||||
} else {
|
||||
$entries2Keep[] = $currentRecord;
|
||||
|
@ -219,7 +219,7 @@ class VoteMapper extends QBMapper {
|
|||
$query->update($this->getTableName())
|
||||
->set('user_id', $query->createNamedParameter($replacementName))
|
||||
->where($query->expr()->eq('user_id', $query->createNamedParameter($userId)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
|
||||
public function fixVoteOptionText(int $pollId, int $optionId, string $searchOptionText, string $replaceOptionText): void {
|
||||
|
@ -229,6 +229,6 @@ class VoteMapper extends QBMapper {
|
|||
->where($query->expr()->eq('vote_option_text', $query->createNamedParameter($searchOptionText)))
|
||||
->andWhere($query->expr()->eq('poll_id', $query->createNamedParameter($pollId)))
|
||||
->andWhere($query->expr()->eq('vote_option_id', $query->createNamedParameter($optionId)))
|
||||
->execute();
|
||||
->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,6 +83,6 @@ class WatchMapper extends QBMapper {
|
|||
->where(
|
||||
$query->expr()->lt('updated', $query->createNamedParameter($offset))
|
||||
);
|
||||
$query->execute();
|
||||
$query->executeStatement();
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче