Commit c975426b authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[TASK] Doctrine DBAL: Use fetchAssociative() instead of fetch()

This change migrates $result->fetch() methods
to $result->fetchAssociative() and $result->closeCursor()
to $result->free() methods.

Since TYPO3 uses fetchMode "associative" by default when
setting up the connections, this change is another
step towards Doctrine DBAL 3.0 compatibility.

Resolves: #94659
Releases: master
Change-Id: Idce7c8466925a6e58059e7e16ebc3ffe35ca6fa6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70125

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent e5805210
...@@ -114,7 +114,7 @@ final class MigrateFeloginPlugins implements UpgradeWizardInterface ...@@ -114,7 +114,7 @@ final class MigrateFeloginPlugins implements UpgradeWizardInterface
->execute(); ->execute();
// Update the found record sets // Update the found record sets
while ($record = $statement->fetch()) { while ($record = $statement->fetchAssociative()) {
$queryBuilder = $connection->createQueryBuilder(); $queryBuilder = $connection->createQueryBuilder();
$updateResult = $queryBuilder->update('tt_content') $updateResult = $queryBuilder->update('tt_content')
->where( ->where(
......
...@@ -196,7 +196,7 @@ class FrontendUserRepositoryTest extends FunctionalTestCase ...@@ -196,7 +196,7 @@ class FrontendUserRepositoryTest extends FunctionalTestCase
)) ))
; ;
$user = $query->execute()->fetch(); $user = $query->execute()->fetchAssociative();
self::assertSame('new-password', $user['password']); self::assertSame('new-password', $user['password']);
self::assertSame('', $user['felogin_forgotHash']); self::assertSame('', $user['felogin_forgotHash']);
......
...@@ -86,7 +86,7 @@ class CategoryCollection extends \TYPO3\CMS\Core\Category\Collection\CategoryCol ...@@ -86,7 +86,7 @@ class CategoryCollection extends \TYPO3\CMS\Core\Category\Collection\CategoryCol
) )
->setMaxResults(1) ->setMaxResults(1)
->execute() ->execute()
->fetch(); ->fetchAssociative();
$collectionRecord['table_name'] = $tableName; $collectionRecord['table_name'] = $tableName;
$collectionRecord['field_name'] = $fieldName; $collectionRecord['field_name'] = $fieldName;
...@@ -157,7 +157,7 @@ class CategoryCollection extends \TYPO3\CMS\Core\Category\Collection\CategoryCol ...@@ -157,7 +157,7 @@ class CategoryCollection extends \TYPO3\CMS\Core\Category\Collection\CategoryCol
// Get the related records from the database // Get the related records from the database
$result = $queryBuilder->execute(); $result = $queryBuilder->execute();
while ($record = $result->fetch()) { while ($record = $result->fetchAssociative()) {
// Overlay the record for workspaces // Overlay the record for workspaces
$pageRepository->versionOL( $pageRepository->versionOL(
$this->getItemTableName(), $this->getItemTableName(),
......
...@@ -5434,7 +5434,7 @@ class ContentObjectRenderer implements LoggerAwareInterface ...@@ -5434,7 +5434,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
) )
->setMaxResults(1) ->setMaxResults(1)
->execute() ->execute()
->fetch(); ->fetchAssociative();
if (is_array($cacheEntry)) { if (is_array($cacheEntry)) {
// Cache hit // Cache hit
...@@ -5487,7 +5487,7 @@ class ContentObjectRenderer implements LoggerAwareInterface ...@@ -5487,7 +5487,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
} }
$result = $queryBuilder->execute(); $result = $queryBuilder->execute();
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
/** @var VersionState $versionState */ /** @var VersionState $versionState */
$versionState = VersionState::cast($row['t3ver_state']); $versionState = VersionState::cast($row['t3ver_state']);
$tsfe->sys_page->versionOL('pages', $row); $tsfe->sys_page->versionOL('pages', $row);
...@@ -5529,7 +5529,7 @@ class ContentObjectRenderer implements LoggerAwareInterface ...@@ -5529,7 +5529,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
$queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($moreWhereClauses)); $queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($moreWhereClauses));
} }
$row = $queryBuilder->execute()->fetch(); $row = $queryBuilder->execute()->fetchAssociative();
$tsfe->sys_page->versionOL('pages', $row); $tsfe->sys_page->versionOL('pages', $row);
if ((int)$row['doktype'] === PageRepository::DOKTYPE_RECYCLER if ((int)$row['doktype'] === PageRepository::DOKTYPE_RECYCLER
|| (int)$row['doktype'] === PageRepository::DOKTYPE_BE_USER_SECTION || (int)$row['doktype'] === PageRepository::DOKTYPE_BE_USER_SECTION
...@@ -5692,7 +5692,7 @@ class ContentObjectRenderer implements LoggerAwareInterface ...@@ -5692,7 +5692,7 @@ class ContentObjectRenderer implements LoggerAwareInterface
$statement = $this->exec_getQuery($tableName, $queryConfiguration); $statement = $this->exec_getQuery($tableName, $queryConfiguration);
$tsfe = $this->getTypoScriptFrontendController(); $tsfe = $this->getTypoScriptFrontendController();
while ($row = $statement->fetch()) { while ($row = $statement->fetchAssociative()) {
// Versioning preview: // Versioning preview:
$tsfe->sys_page->versionOL($tableName, $row, true); $tsfe->sys_page->versionOL($tableName, $row, true);
......
...@@ -667,7 +667,7 @@ abstract class AbstractMenuContentObject ...@@ -667,7 +667,7 @@ abstract class AbstractMenuContentObject
} }
// Get sub-pages: // Get sub-pages:
$statement = $this->parent_cObj->exec_getQuery('pages', ['pidInList' => $id, 'orderBy' => $sortingField]); $statement = $this->parent_cObj->exec_getQuery('pages', ['pidInList' => $id, 'orderBy' => $sortingField]);
while ($row = $statement->fetch()) { while ($row = $statement->fetchAssociative()) {
// When the site language configuration is in "free" mode, then the page without overlay is fetched // When the site language configuration is in "free" mode, then the page without overlay is fetched
// (which is kind-of strange for pages, but this is what exec_getQuery() is doing) // (which is kind-of strange for pages, but this is what exec_getQuery() is doing)
// this means, that $row is a translated page, but hasn't been overlaid. For this reason, we fetch // this means, that $row is a translated page, but hasn't been overlaid. For this reason, we fetch
...@@ -830,7 +830,7 @@ abstract class AbstractMenuContentObject ...@@ -830,7 +830,7 @@ abstract class AbstractMenuContentObject
'orderBy' => $sortingField ?: $sortField . ' DESC', 'orderBy' => $sortingField ?: $sortField . ' DESC',
'max' => $limit 'max' => $limit
]); ]);
while ($row = $statement->fetch()) { while ($row = $statement->fetchAssociative()) {
// When the site language configuration is in "free" mode, then the page without overlay is fetched // When the site language configuration is in "free" mode, then the page without overlay is fetched
// (which is kind-of strange for pages, but this is what exec_getQuery() is doing) // (which is kind-of strange for pages, but this is what exec_getQuery() is doing)
// this means, that $row is a translated page, but hasn't been overlaid. For this reason, we fetch // this means, that $row is a translated page, but hasn't been overlaid. For this reason, we fetch
...@@ -956,7 +956,7 @@ abstract class AbstractMenuContentObject ...@@ -956,7 +956,7 @@ abstract class AbstractMenuContentObject
} }
$result = $queryBuilder->execute(); $result = $queryBuilder->execute();
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$tsfe->sys_page->versionOL('pages', $row, true); $tsfe->sys_page->versionOL('pages', $row, true);
if (is_array($row)) { if (is_array($row)) {
$menuItems[$row['uid']] = $this->sys_page->getPageOverlay($row); $menuItems[$row['uid']] = $this->sys_page->getPageOverlay($row);
...@@ -1869,7 +1869,7 @@ abstract class AbstractMenuContentObject ...@@ -1869,7 +1869,7 @@ abstract class AbstractMenuContentObject
throw new \UnexpectedValueException($message, 1337334849); throw new \UnexpectedValueException($message, 1337334849);
} }
$result = []; $result = [];
while ($row = $statement->fetch()) { while ($row = $statement->fetchAssociative()) {
$this->sys_page->versionOL('tt_content', $row); $this->sys_page->versionOL('tt_content', $row);
if ($this->getCurrentLanguageAspect()->doOverlays() && $basePageRow['_PAGES_OVERLAY_LANGUAGE']) { if ($this->getCurrentLanguageAspect()->doOverlays() && $basePageRow['_PAGES_OVERLAY_LANGUAGE']) {
$row = $this->sys_page->getRecordOverlay( $row = $this->sys_page->getRecordOverlay(
......
...@@ -858,7 +858,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -858,7 +858,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
} }
$queryBuilder->andWhere($constraint); $queryBuilder->andWhere($constraint);
$page = $queryBuilder->execute()->fetch(); $page = $queryBuilder->execute()->fetchAssociative();
if ($this->whichWorkspace() > 0) { if ($this->whichWorkspace() > 0) {
// Fetch overlay of page if in workspace and check if it is hidden // Fetch overlay of page if in workspace and check if it is hidden
...@@ -1280,7 +1280,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -1280,7 +1280,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
$this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
// versionOL()? // versionOL()?
if (!$row) { if (!$row) {
...@@ -3341,7 +3341,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface ...@@ -3341,7 +3341,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
$timeConditions $timeConditions
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
if ($row) { if ($row) {
foreach ($timeFields as $timeField => $_) { foreach ($timeFields as $timeField => $_) {
......
...@@ -729,7 +729,7 @@ class AbstractPlugin ...@@ -729,7 +729,7 @@ class AbstractPlugin
$tRows[] = $this->pi_list_header(); $tRows[] = $this->pi_list_header();
// Make list table rows // Make list table rows
$c = 0; $c = 0;
while ($this->internal['currentRow'] = $statement->fetch()) { while ($this->internal['currentRow'] = $statement->fetchAssociative()) {
$tRows[] = $this->pi_list_row($c); $tRows[] = $this->pi_list_row($c);
$c++; $c++;
} }
...@@ -1246,7 +1246,7 @@ class AbstractPlugin ...@@ -1246,7 +1246,7 @@ class AbstractPlugin
$result = $queryBuilder->execute(); $result = $queryBuilder->execute();
$outArr = []; $outArr = [];
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$outArr[$row['uid']] = $row; $outArr[$row['uid']] = $row;
} }
return $outArr; return $outArr;
......
...@@ -602,7 +602,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder ...@@ -602,7 +602,7 @@ class PageLinkBuilder extends AbstractTypolinkBuilder
$queryBuilder->createNamedParameter(PageRepository::DOKTYPE_BE_USER_SECTION, \PDO::PARAM_INT) $queryBuilder->createNamedParameter(PageRepository::DOKTYPE_BE_USER_SECTION, \PDO::PARAM_INT)
) )
)->execute(); )->execute();
while ($row = $queryResult->fetch()) { while ($row = $queryResult->fetchAssociative()) {
// Find mount point if any: // Find mount point if any:
$next_id = (int)$row['uid']; $next_id = (int)$row['uid'];
$next_MP_array = $MP_array; $next_MP_array = $MP_array;
......
...@@ -378,7 +378,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase ...@@ -378,7 +378,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase
{ {
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template'); $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template');
$template = $connection->select(['uid', 'constants'], 'sys_template', ['pid' => $pageId, 'root' => 1])->fetch(); $template = $connection->select(['uid', 'constants'], 'sys_template', ['pid' => $pageId, 'root' => 1])->fetchAssociative();
if (empty($template)) { if (empty($template)) {
self::fail('Cannot find root template on page with id: "' . $pageId . '"'); self::fail('Cannot find root template on page with id: "' . $pageId . '"');
} }
......
...@@ -302,7 +302,7 @@ class FrontendUserAuthenticationTest extends UnitTestCase ...@@ -302,7 +302,7 @@ class FrontendUserAuthenticationTest extends UnitTestCase
$queryBuilderFeUserProphecy->where(Argument::cetera())->shouldBeCalled()->willReturn($queryBuilderFeUserProphecyRevelation); $queryBuilderFeUserProphecy->where(Argument::cetera())->shouldBeCalled()->willReturn($queryBuilderFeUserProphecyRevelation);
$statementFeUserProphecy = $this->prophesize(Statement::class); $statementFeUserProphecy = $this->prophesize(Statement::class);
$queryBuilderFeUserProphecy->execute()->shouldBeCalled()->willReturn($statementFeUserProphecy->reveal()); $queryBuilderFeUserProphecy->execute()->shouldBeCalled()->willReturn($statementFeUserProphecy->reveal());
$statementFeUserProphecy->fetch()->willReturn( $statementFeUserProphecy->fetchAssociative()->willReturn(
[ [
'uid' => 1, 'uid' => 1,
'username' => 'existingUserName', 'username' => 'existingUserName',
......
...@@ -172,7 +172,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase ...@@ -172,7 +172,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase
public function sectionIndexReturnsOverlaidRowBasedOnTheLanguageOfTheGivenPage() public function sectionIndexReturnsOverlaidRowBasedOnTheLanguageOfTheGivenPage()
{ {
$statementProphet = $this->prophesize(Statement::class); $statementProphet = $this->prophesize(Statement::class);
$statementProphet->fetch()->shouldBeCalledTimes(2)->willReturn(['uid' => 0, 'header' => 'NOT_OVERLAID'], false); $statementProphet->fetchAssociative()->shouldBeCalledTimes(2)->willReturn(['uid' => 0, 'header' => 'NOT_OVERLAID'], false);
$this->prepareSectionIndexTest(); $this->prepareSectionIndexTest();
$this->subject->_set('mconf', [ $this->subject->_set('mconf', [
...@@ -246,7 +246,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase ...@@ -246,7 +246,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase
public function sectionIndexFilters($expectedAmount, array $dataRow) public function sectionIndexFilters($expectedAmount, array $dataRow)
{ {
$statementProphet = $this->prophesize(Statement::class); $statementProphet = $this->prophesize(Statement::class);
$statementProphet->fetch()->willReturn($dataRow, false); $statementProphet->fetchAssociative()->willReturn($dataRow, false);
$this->prepareSectionIndexTest(); $this->prepareSectionIndexTest();
$this->subject->_set('mconf', [ $this->subject->_set('mconf', [
...@@ -315,7 +315,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase ...@@ -315,7 +315,7 @@ class AbstractMenuContentObjectTest extends UnitTestCase
public function sectionIndexQueriesWithDifferentColPos($configuration, $colPosFromStdWrapValue, $whereClausePrefix) public function sectionIndexQueriesWithDifferentColPos($configuration, $colPosFromStdWrapValue, $whereClausePrefix)
{ {
$statementProphet = $this->prophesize(Statement::class); $statementProphet = $this->prophesize(Statement::class);
$statementProphet->fetch()->willReturn([]); $statementProphet->fetchAssociative()->willReturn([]);
$this->prepareSectionIndexTest(); $this->prepareSectionIndexTest();
$this->subject->_set('mconf', ['sectionIndex.' => $configuration]); $this->subject->_set('mconf', ['sectionIndex.' => $configuration]);
......
...@@ -207,7 +207,7 @@ class ExportController extends ImportExportController ...@@ -207,7 +207,7 @@ class ExportController extends ImportExportController
$rParts = explode(':', $ref); $rParts = explode(':', $ref);
if ($beUser->check('tables_select', $rParts[0])) { if ($beUser->check('tables_select', $rParts[0])) {
$statement = $this->exec_listQueryPid($rParts[0], (int)$rParts[1]); $statement = $this->exec_listQueryPid($rParts[0], (int)$rParts[1]);
while ($subTrow = $statement->fetch()) { while ($subTrow = $statement->fetchAssociative()) {
$this->export->export_addRecord($rParts[0], $subTrow); $this->export->export_addRecord($rParts[0], $subTrow);
} }
} }
...@@ -391,7 +391,7 @@ class ExportController extends ImportExportController ...@@ -391,7 +391,7 @@ class ExportController extends ImportExportController
&& !$GLOBALS['TCA'][$table]['ctrl']['is_static'] && !$GLOBALS['TCA'][$table]['ctrl']['is_static']
) { ) {
$statement = $this->exec_listQueryPid($table, $k); $statement = $this->exec_listQueryPid($table, $k);
while ($subTrow = $statement->fetch()) { while ($subTrow = $statement->fetchAssociative()) {
$this->export->export_addRecord($table, $subTrow); $this->export->export_addRecord($table, $subTrow);
} }
} }
......
...@@ -70,7 +70,7 @@ class PresetRepository ...@@ -70,7 +70,7 @@ class PresetRepository
} }
$presets = $queryBuilder->execute(); $presets = $queryBuilder->execute();
while ($presetCfg = $presets->fetch()) { while ($presetCfg = $presets->fetchAssociative()) {
$options[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']' $options[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']'
. ($presetCfg['public'] ? ' [Public]' : '') . ($presetCfg['public'] ? ' [Public]' : '')
. ($presetCfg['user_uid'] === $this->getBackendUser()->user['uid'] ? ' [Own]' : ''); . ($presetCfg['user_uid'] === $this->getBackendUser()->user['uid'] ? ' [Own]' : '');
...@@ -98,7 +98,7 @@ class PresetRepository ...@@ -98,7 +98,7 @@ class PresetRepository
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
} }
/** /**
......
...@@ -535,7 +535,7 @@ class Import extends ImportExport ...@@ -535,7 +535,7 @@ class Import extends ImportExport
->orderBy('uid') ->orderBy('uid')
->execute(); ->execute();
$rows = []; $rows = [];
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$rows[$row['uid']] = $row; $rows[$row['uid']] = $row;
} }
return $rows; return $rows;
...@@ -840,7 +840,7 @@ class Import extends ImportExport ...@@ -840,7 +840,7 @@ class Import extends ImportExport
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
// if no record could be found, $this->import_mapId['sys_file'][$record['file']] is pointing // if no record could be found, $this->import_mapId['sys_file'][$record['file']] is pointing
// to a file, that was already there, thus a new metadata record should be created // to a file, that was already there, thus a new metadata record should be created
if (is_array($recordInDatabase)) { if (is_array($recordInDatabase)) {
......
...@@ -148,7 +148,7 @@ abstract class AbstractImportExportTestCase extends FunctionalTestCase ...@@ -148,7 +148,7 @@ abstract class AbstractImportExportTestCase extends FunctionalTestCase
$queryBuilder->addOrderBy('uid', 'ASC'); $queryBuilder->addOrderBy('uid', 'ASC');
$result = $queryBuilder->execute(); $result = $queryBuilder->execute();
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$export->export_addRecord($table, $this->forceStringsOnRowValues($row)); $export->export_addRecord($table, $this->forceStringsOnRowValues($row));
} }
} }
......
...@@ -293,7 +293,7 @@ class AdministrationController extends ActionController ...@@ -293,7 +293,7 @@ class AdministrationController extends ActionController
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
if (!is_array($pageHashRow)) { if (!is_array($pageHashRow)) {
$this->redirect('statistic'); $this->redirect('statistic');
...@@ -310,7 +310,7 @@ class AdministrationController extends ActionController ...@@ -310,7 +310,7 @@ class AdministrationController extends ActionController
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
$debugInfo = []; $debugInfo = [];
$lexer = ''; $lexer = '';
if (is_array($debugRow)) { if (is_array($debugRow)) {
......
...@@ -309,7 +309,7 @@ class SearchController extends ActionController ...@@ -309,7 +309,7 @@ class SearchController extends ActionController
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
$categoryTitle = LocalizationUtility::translate('indexingConfigurationHeader.' . $freeIndexUid, 'IndexedSearch'); $categoryTitle = LocalizationUtility::translate('indexingConfigurationHeader.' . $freeIndexUid, 'IndexedSearch');
$categoryTitle = $categoryTitle ?: $indexCfgRec['title']; $categoryTitle = $categoryTitle ?: $indexCfgRec['title'];
} else { } else {
...@@ -752,7 +752,7 @@ class SearchController extends ActionController ...@@ -752,7 +752,7 @@ class SearchController extends ActionController
) )
) )
->execute() ->execute()
->fetch(); ->fetchAssociative();
if ($ftdrow !== false) { if ($ftdrow !== false) {
// Cut HTTP references after some length // Cut HTTP references after some length
$content = preg_replace('/(http:\\/\\/[^ ]{' . $this->settings['results.']['hrefInSummaryCropAfter'] . '})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']); $content = preg_replace('/(http:\\/\\/[^ ]{' . $this->settings['results.']['hrefInSummaryCropAfter'] . '})([^ ]+)/i', '$1...', $ftdrow['fulltextdata']);
...@@ -1198,7 +1198,7 @@ class SearchController extends ActionController ...@@ -1198,7 +1198,7 @@ class SearchController extends ActionController
) )
->execute(); ->execute();
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$indexId = (int)$row['uid']; $indexId = (int)$row['uid'];
$title = LocalizationUtility::translate('indexingConfigurations.' . $indexId, 'IndexedSearch'); $title = LocalizationUtility::translate('indexingConfigurations.' . $indexId, 'IndexedSearch');
$allOptions[$indexId] = $title ?: $row['title']; $allOptions[$indexId] = $title ?: $row['title'];
......
...@@ -78,7 +78,7 @@ class AdministrationRepository ...@@ -78,7 +78,7 @@ class AdministrationRepository
->execute() ->execute()
->fetchOne(); ->fetchOne();
$allRows = []; $allRows = [];
while ($row = $result->fetch()) { while ($row = $result->fetchAssociative()) {
$row['pcount'] = $numberOfRows; $row['pcount'] = $numberOfRows;
$allRows[] = $row; $allRows[] = $row;
} }
...@@ -172,7 +172,7 @@ class AdministrationRepository ...@@ -172,7 +172,7 @@ class AdministrationRepository
->orderBy('item_type') ->orderBy('item_type')
->execute(); ->execute();
while ($row = $res->fetch()) { while ($row = $res->fetchAssociative()) {
$this->addAdditionalInformation($row); $this->addAdditionalInformation($row);
$result[] = $row; $result[] = $row;
...@@ -192,7 +192,7 @@ class AdministrationRepository ...@@ -192,7 +192,7 @@ class AdministrationRepository
) )
) )
->execute(); ->execute();
while ($row2 = $res2->fetch()) { while ($row2 = $res2->fetchAssociative()) {
$this->addAdditionalInformation($row2); $this->addAdditionalInformation($row2);
$result[] = $row2; $result[] = $row2;
} }
...@@ -255,7 +255,7 @@ class AdministrationRepository ...@@ -255,7 +255,7 @@ class AdministrationRepository
->orderBy('item_type') ->orderBy('item_type')
->execute(); ->execute();
while ($row = $res->fetch()) { while ($row = $res->fetchAssociative()) {
$itemType = $row['item_type']; $itemType = $row['item_type'];
$counts[] = [ $counts[] = [
'count' => $row['count'], 'count' => $row['count'],
...@@ -356,7 +356,7 @@ class AdministrationRepository ...@@ -356,7 +356,7 @@ class AdministrationRepository
->orderBy('data_page_id') ->orderBy('data_page_id')
->execute(); ->execute();
while ($row = $res->fetch()) { while ($row = $res->fetchAssociative()) {
$this->addAdditionalInformation($row); $this->addAdditionalInformation($row);
$result[] = $row; $result[] = $row;
...@@ -375,7 +375,7 @@ class AdministrationRepository ...@@ -375,7 +375,7 @@ class AdministrationRepository
) )
) )
->execute(); ->execute();