Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/contactsinteraction/lib/Db/RecentContactMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function findLastUpdatedForUserId(string $uid): ?int {
->setMaxResults(1);

$cursor = $select->executeQuery();
$row = $cursor->fetch();
$row = $cursor->fetchAssociative();

if ($row === false) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function run(IOutput $output): void {
->set('card', $query->createParameter('card'))
->where($query->expr()->eq('id', $query->createParameter('id')));

while ($card = $cardsWithTranslatedCategory->fetch()) {
while ($card = $cardsWithTranslatedCategory->fetchAssociative()) {
$output->advance(1);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private function buildIndex(int $offset, int $stopAt):int {
->orderBy('id', 'ASC');

$result = $query->executeQuery();
while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
while ($row = $result->fetchAssociative()) {
$offset = (int)$row['id'];
if (is_resource($row['calendardata'])) {
$row['calendardata'] = stream_get_contents($row['calendardata']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function cleanUpOrphans(
}

$result = $selectQb->executeQuery();
$rows = $result->fetchAll();
$rows = $result->fetchAllAssociative();
$result->closeCursor();
if (empty($rows)) {
return 0;
Expand Down
78 changes: 39 additions & 39 deletions apps/dav/lib/CalDAV/CalDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function getDeletedCalendars(int $deletedBefore): array {
->andWhere($qb->expr()->lt('deleted_at', $qb->createNamedParameter($deletedBefore)));
$result = $qb->executeQuery();
$calendars = [];
while (($row = $result->fetch()) !== false) {
while (($row = $result->fetchAssociative()) !== false) {
$calendars[] = [
'id' => (int)$row['id'],
'deleted_at' => (int)$row['deleted_at'],
Expand Down Expand Up @@ -345,7 +345,7 @@ public function getCalendarsForUser($principalUri) {
$result = $query->executeQuery();

$calendars = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
Expand Down Expand Up @@ -408,7 +408,7 @@ public function getCalendarsForUser($principalUri) {
$results = $select->executeQuery();

$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
while ($row = $results->fetch()) {
while ($row = $results->fetchAssociative()) {
$row['principaluri'] = (string)$row['principaluri'];
if ($row['principaluri'] === $principalUri) {
continue;
Expand Down Expand Up @@ -478,7 +478,7 @@ public function getUsersOwnCalendars($principalUri) {
->orderBy('calendarorder', 'ASC');
$stmt = $query->executeQuery();
$calendars = [];
while ($row = $stmt->fetch()) {
while ($row = $stmt->fetchAssociative()) {
$row['principaluri'] = (string)$row['principaluri'];
$components = [];
if ($row['components']) {
Expand Down Expand Up @@ -528,7 +528,7 @@ public function getPublicCalendars() {
->andWhere($query->expr()->eq('s.type', $query->createNamedParameter('calendar')))
->executeQuery();

while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$row['principaluri'] = (string)$row['principaluri'];
[, $name] = Uri\split($row['principaluri']);
$row['displayname'] = $row['displayname'] . "($name)";
Expand Down Expand Up @@ -586,7 +586,7 @@ public function getPublicCalendar($uri) {
->andWhere($query->expr()->eq('s.publicuri', $query->createNamedParameter($uri)))
->executeQuery();

$row = $result->fetch();
$row = $result->fetchAssociative();

$result->closeCursor();

Expand Down Expand Up @@ -643,7 +643,7 @@ public function getCalendarByUri($principal, $uri) {
->setMaxResults(1);
$stmt = $query->executeQuery();

$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();
if ($row === false) {
return null;
Expand Down Expand Up @@ -692,7 +692,7 @@ public function getCalendarById(int $calendarId): ?array {
->setMaxResults(1);
$stmt = $query->executeQuery();

$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();
if ($row === false) {
return null;
Expand Down Expand Up @@ -740,7 +740,7 @@ public function getSubscriptionById($subscriptionId) {
->orderBy('calendarorder', 'asc');
$stmt = $query->executeQuery();

$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();
if ($row === false) {
return null;
Expand Down Expand Up @@ -777,7 +777,7 @@ public function getSubscriptionByUri(string $principal, string $uri): ?array {
->setMaxResults(1);
$stmt = $query->executeQuery();

$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();
if ($row === false) {
return null;
Expand Down Expand Up @@ -1044,7 +1044,7 @@ public function exportCalendar(int $calendarId, int $calendarType = self::CALEND
$rs = $qb->executeQuery();
// iterate through results
try {
while (($row = $rs->fetch()) !== false) {
while (($row = $rs->fetchAssociative()) !== false) {
yield $row;
}
} finally {
Expand Down Expand Up @@ -1076,7 +1076,7 @@ public function getLimitedCalendarObjects(int $calendarId, int $calendarType = s
$stmt = $query->executeQuery();

$result = [];
while (($row = $stmt->fetch()) !== false) {
while (($row = $stmt->fetchAssociative()) !== false) {
$result[$row['uid']] = [
'id' => $row['id'],
'etag' => $row['etag'],
Expand Down Expand Up @@ -1141,7 +1141,7 @@ public function getCalendarObjects($calendarId, $calendarType = self::CALENDAR_T
$stmt = $query->executeQuery();

$result = [];
while (($row = $stmt->fetch()) !== false) {
while (($row = $stmt->fetchAssociative()) !== false) {
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
Expand All @@ -1168,7 +1168,7 @@ public function getDeletedCalendarObjects(int $deletedBefore): array {
$stmt = $query->executeQuery();

$result = [];
while (($row = $stmt->fetch()) !== false) {
while (($row = $stmt->fetchAssociative()) !== false) {
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
Expand Down Expand Up @@ -1207,7 +1207,7 @@ public function getDeletedCalendarObjectsByPrincipal(string $principalUri): arra
$stmt = $query->executeQuery();

$result = [];
while ($row = $stmt->fetch()) {
while ($row = $stmt->fetchAssociative()) {
$result[] = [
'id' => $row['id'],
'uri' => $row['uri'],
Expand Down Expand Up @@ -1255,7 +1255,7 @@ public function getCalendarObject($calendarId, $objectUri, int $calendarType = s
->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri)))
->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType)));
$stmt = $query->executeQuery();
$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();

if (!$row) {
Expand Down Expand Up @@ -1316,7 +1316,7 @@ public function getMultipleCalendarObjects($calendarId, array $uris, $calendarTy
$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
$result = $query->executeQuery();

while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$objects[] = [
'id' => $row['id'],
'uri' => $row['uri'],
Expand Down Expand Up @@ -1383,7 +1383,7 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData, $ca
->andWhere($qbDel->expr()->eq('calendartype', $qbDel->createNamedParameter($calendarType)))
->andWhere($qbDel->expr()->isNotNull('deleted_at'));
$result = $qbDel->executeQuery();
$found = $result->fetch();
$found = $result->fetchAssociative();
$result->closeCursor();
if ($found !== false) {
// the object existed previously but has been deleted
Expand Down Expand Up @@ -1675,7 +1675,7 @@ public function restoreCalendarObject(array $objectData): void {
->from('calendarobjects')
->where($qb2->expr()->eq('id', $qb2->createNamedParameter($id, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT));
$result = $selectObject->executeQuery();
$row = $result->fetch();
$row = $result->fetchAssociative();
$result->closeCursor();
if ($row === false) {
// Welp, this should possibly not have happened, but let's ignore
Expand Down Expand Up @@ -1798,7 +1798,7 @@ public function calendarQuery($calendarId, array $filters, $calendarType = self:
$stmt = $query->executeQuery();

$result = [];
while ($row = $stmt->fetch()) {
while ($row = $stmt->fetchAssociative()) {
// if we leave it as a blob we can't read it both from the post filter and the rowToCalendarObject
if (isset($row['calendardata'])) {
$row['calendardata'] = $this->readBlob($row['calendardata']);
Expand Down Expand Up @@ -1958,7 +1958,7 @@ public function calendarSearch($principalUri, array $filters, $limit = null, $of
$stmt = $query->executeQuery();

$result = [];
while ($row = $stmt->fetch()) {
while ($row = $stmt->fetchAssociative()) {
$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
if (!in_array($path, $result)) {
$result[] = $path;
Expand Down Expand Up @@ -2171,7 +2171,7 @@ private function searchCalendarObjects(IQueryBuilder $query, ?DateTimeInterface

$result = $query->executeQuery();

while (($row = $result->fetch()) !== false) {
while (($row = $result->fetchAssociative()) !== false) {
if ($filterByTimeRange === false) {
// No filter required
$calendarObjects[] = $row;
Expand Down Expand Up @@ -2399,7 +2399,7 @@ public function searchPrincipalUri(string $principalUri,

$result = $calendarObjectIdQuery->executeQuery();
$matches = [];
while (($row = $result->fetch()) !== false) {
while (($row = $result->fetchAssociative()) !== false) {
$matches[] = (int)$row['objectid'];
}
$result->closeCursor();
Expand All @@ -2411,7 +2411,7 @@ public function searchPrincipalUri(string $principalUri,

$result = $query->executeQuery();
$calendarObjects = [];
while (($array = $result->fetch()) !== false) {
while (($array = $result->fetchAssociative()) !== false) {
$array['calendarid'] = (int)$array['calendarid'];
$array['calendartype'] = (int)$array['calendartype'];
$array['calendardata'] = $this->readBlob($array['calendardata']);
Expand Down Expand Up @@ -2456,7 +2456,7 @@ public function getCalendarObjectByUID($principalUri, $uid, $calendarUri = null)
}

$stmt = $query->executeQuery();
$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();
if ($row) {
return $row['calendaruri'] . '/' . $row['objecturi'];
Expand All @@ -2474,7 +2474,7 @@ public function getCalendarObjectById(string $principalUri, int $id): ?array {
->where($query->expr()->eq('c.principaluri', $query->createNamedParameter($principalUri)))
->andWhere($query->expr()->eq('co.id', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT));
$stmt = $query->executeQuery();
$row = $stmt->fetch();
$row = $stmt->fetchAssociative();
$stmt->closeCursor();

if (!$row) {
Expand Down Expand Up @@ -2600,11 +2600,11 @@ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limi
$result = ['syncToken' => $currentToken, 'added' => [], 'modified' => [], 'deleted' => []];
// retrieve results
if ($initialSync) {
$result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
$result['added'] = $stmt->fetchFirstColumn();
} else {
// \PDO::FETCH_NUM is needed due to the inconsistent field names
// produced by doctrine for MAX() with different databases
while ($entry = $stmt->fetch(\PDO::FETCH_NUM)) {
while ($entry = $stmt->fetchNumeric()) {
// assign uri (column 0) to appropriate mutation based on operation (column 1)
// forced (int) is needed as doctrine with OCI returns the operation field as string not integer
match ((int)$entry[1]) {
Expand Down Expand Up @@ -2670,7 +2670,7 @@ public function getSubscriptionsForUser($principalUri) {
$stmt = $query->executeQuery();

$subscriptions = [];
while ($row = $stmt->fetch()) {
while ($row = $stmt->fetchAssociative()) {
$subscription = [
'id' => $row['id'],
'uri' => $row['uri'],
Expand Down Expand Up @@ -2855,7 +2855,7 @@ public function getSchedulingObject($principalUri, $objectUri) {
->andWhere($query->expr()->eq('uri', $query->createNamedParameter($objectUri)))
->executeQuery();

$row = $stmt->fetch();
$row = $stmt->fetchAssociative();

if (!$row) {
return null;
Expand Down Expand Up @@ -2889,7 +2889,7 @@ public function getSchedulingObjects($principalUri) {
->executeQuery();

$results = [];
while (($row = $stmt->fetch()) !== false) {
while (($row = $stmt->fetchAssociative()) !== false) {
$results[] = [
'calendardata' => $row['calendardata'],
'uri' => $row['uri'],
Expand Down Expand Up @@ -2939,7 +2939,7 @@ public function deleteOutdatedSchedulingObjects(int $modifiedBefore, int $limit)
}
$ids = array_map(static function (array $id) {
return (int)$id[0];
}, $result->fetchAll(\PDO::FETCH_NUM));
}, $result->fetchAllNumeric());
$result->closeCursor();

$numDeleted = 0;
Expand Down Expand Up @@ -3040,7 +3040,7 @@ public function restoreChanges(int $calendarId, int $calendarType = self::CALEND
)
);
$resultAdded = $qbAdded->executeQuery();
$addedUris = $resultAdded->fetchAll(\PDO::FETCH_COLUMN);
$addedUris = $resultAdded->fetchFirstColumn();
$resultAdded->closeCursor();
// Track everything as changed
// Tracking the creation is not necessary because \OCA\DAV\CalDAV\CalDavBackend::getChangesForCalendar
Expand All @@ -3060,7 +3060,7 @@ public function restoreChanges(int $calendarId, int $calendarType = self::CALEND
$resultDeleted = $qbDeleted->executeQuery();
$deletedUris = array_map(function (string $uri) {
return str_replace('-deleted.ics', '.ics', $uri);
}, $resultDeleted->fetchAll(\PDO::FETCH_COLUMN));
}, $resultDeleted->fetchFirstColumn());
$resultDeleted->closeCursor();
$this->addChanges($calendarId, $deletedUris, 3, $calendarType);
}, $this->db);
Expand Down Expand Up @@ -3306,7 +3306,7 @@ public function preloadPublishStatuses(array $resourceIds): void {
->executeQuery();

$hasPublishStatuses = [];
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
$this->publishStatusCache->set((string)$row['resourceid'], $row['publicuri']);
$hasPublishStatuses[(int)$row['resourceid']] = true;
}
Expand Down Expand Up @@ -3419,7 +3419,7 @@ public function deleteAllBirthdayCalendars() {
->where($query->expr()->eq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)))
->executeQuery();

while (($row = $result->fetch()) !== false) {
while (($row = $result->fetchAssociative()) !== false) {
$this->deleteCalendar(
$row['id'],
true // No data to keep in the trashbin, if the user re-enables then we regenerate
Expand All @@ -3442,7 +3442,7 @@ public function purgeAllCachedEventsForSubscription($subscriptionId) {
$stmt = $query->executeQuery();

$uris = [];
while (($row = $stmt->fetch()) !== false) {
while (($row = $stmt->fetchAssociative()) !== false) {
$uris[] = $row['uri'];
}
$stmt->closeCursor();
Expand Down Expand Up @@ -3568,7 +3568,7 @@ protected function getCalendarObjectId($calendarId, $uri, $calendarType):int {
->andWhere($query->expr()->eq('calendartype', $query->createNamedParameter($calendarType)));

$result = $query->executeQuery();
$objectIds = $result->fetch();
$objectIds = $result->fetchAssociative();
$result->closeCursor();

if (!isset($objectIds['id'])) {
Expand Down Expand Up @@ -3713,7 +3713,7 @@ protected function purgeCalendarInvitations(int $calendarId): void {
$cmd->select('uid')
->from($this->dbObjectsTable)
->where($cmd->expr()->eq('calendarid', $cmd->createNamedParameter($calendarId)));
$allIds = $cmd->executeQuery()->fetchAll(\PDO::FETCH_COLUMN);
$allIds = $cmd->executeQuery()->fetchFirstColumn();
// delete all links that match object uid's
$cmd = $this->db->getQueryBuilder();
$cmd->delete($this->dbObjectInvitationsTable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function findAll(): \Generator {
->from(self::TABLE_NAME);

$result = $qb->executeQuery();
while ($row = $result->fetch()) {
while ($row = $result->fetchAssociative()) {
yield $this->mapRowToEntity($row);
}
$result->closeCursor();
Expand Down
Loading
Loading