‪TYPO3CMS  10.4
Typo3DbBackend.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Doctrine\DBAL\DBALException;
21 use Doctrine\DBAL\Platforms\SQLServerPlatform;
49 
55 {
59  protected ‪$connectionPool;
60 
64  protected ‪$configurationManager;
65 
69  protected ‪$cacheService;
70 
75 
79  protected ‪$objectManager;
80 
87  protected ‪$hasPidColumn = [];
88 
93  {
94  $this->configurationManager = ‪$configurationManager;
95  }
96 
101  {
102  $this->cacheService = ‪$cacheService;
103  }
104 
109  {
110  $this->environmentService = ‪$environmentService;
111  }
112 
117  {
118  $this->objectManager = ‪$objectManager;
119  }
120 
124  public function ‪__construct()
125  {
126  $this->connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
127  }
128 
138  public function ‪addRow(string $tableName, array $fieldValues, bool $isRelation = false): int
139  {
140  if (isset($fieldValues['uid'])) {
141  unset($fieldValues['uid']);
142  }
143  try {
144  $connection = $this->connectionPool->getConnectionForTable($tableName);
145 
146  $types = [];
147  $platform = $connection->getDatabasePlatform();
148  if ($platform instanceof SQLServerPlatform) {
149  // mssql needs to set proper PARAM_LOB and others to update fields
150  $tableDetails = $connection->getSchemaManager()->listTableDetails($tableName);
151  foreach ($fieldValues as $columnName => $columnValue) {
152  $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType();
153  }
154  }
155 
156  $connection->insert($tableName, $fieldValues, $types);
157  } catch (DBALException $e) {
158  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230766, $e);
159  }
160 
161  $uid = 0;
162  if (!$isRelation) {
163  // Relation tables have no auto_increment column, so no retrieval must be tried.
164  $uid = (int)$connection->lastInsertId($tableName);
165  $this->‪clearPageCache($tableName, $uid);
166  }
167  return $uid;
168  }
169 
179  public function ‪updateRow(string $tableName, array $fieldValues, bool $isRelation = false): void
180  {
181  if (!isset($fieldValues['uid'])) {
182  throw new \InvalidArgumentException('The given row must contain a value for "uid".', 1476045164);
183  }
184 
185  $uid = (int)$fieldValues['uid'];
186  unset($fieldValues['uid']);
187 
188  try {
189  $connection = $this->connectionPool->getConnectionForTable($tableName);
190 
191  $types = [];
192  $platform = $connection->getDatabasePlatform();
193  if ($platform instanceof SQLServerPlatform) {
194  // mssql needs to set proper PARAM_LOB and others to update fields
195  $tableDetails = $connection->getSchemaManager()->listTableDetails($tableName);
196  foreach ($fieldValues as $columnName => $columnValue) {
197  $columnName = (string)$columnName;
198  $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType();
199  }
200  }
201 
202  $connection->update($tableName, $fieldValues, ['uid' => $uid], $types);
203  } catch (DBALException $e) {
204  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230767, $e);
205  }
206 
207  if (!$isRelation) {
208  $this->‪clearPageCache($tableName, $uid);
209  }
210  }
211 
220  public function ‪updateRelationTableRow(string $tableName, array $fieldValues): void
221  {
222  if (!isset($fieldValues['uid_local']) && !isset($fieldValues['uid_foreign'])) {
223  throw new \InvalidArgumentException(
224  'The given fieldValues must contain a value for "uid_local" and "uid_foreign".',
225  1360500126
226  );
227  }
228 
229  $where = [];
230  $where['uid_local'] = (int)$fieldValues['uid_local'];
231  $where['uid_foreign'] = (int)$fieldValues['uid_foreign'];
232  unset($fieldValues['uid_local']);
233  unset($fieldValues['uid_foreign']);
234 
235  if (!empty($fieldValues['tablenames'])) {
236  $where['tablenames'] = $fieldValues['tablenames'];
237  unset($fieldValues['tablenames']);
238  }
239  if (!empty($fieldValues['fieldname'])) {
240  $where['fieldname'] = $fieldValues['fieldname'];
241  unset($fieldValues['fieldname']);
242  }
243 
244  try {
245  $this->connectionPool->getConnectionForTable($tableName)->update($tableName, $fieldValues, $where);
246  } catch (DBALException $e) {
247  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230768, $e);
248  }
249  }
250 
259  public function ‪removeRow(string $tableName, array $where, bool $isRelation = false): void
260  {
261  try {
262  $this->connectionPool->getConnectionForTable($tableName)->delete($tableName, $where);
263  } catch (DBALException $e) {
264  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230769, $e);
265  }
266 
267  if (!$isRelation && isset($where['uid'])) {
268  $this->‪clearPageCache($tableName, (int)$where['uid']);
269  }
270  }
271 
281  public function ‪getMaxValueFromTable(string $tableName, array $where, string $columnName)
282  {
283  try {
284  $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
285  $queryBuilder->getRestrictions()->removeAll();
286  $queryBuilder
287  ->select($columnName)
288  ->from($tableName)
289  ->orderBy($columnName, 'DESC')
290  ->setMaxResults(1);
291 
292  foreach ($where as $fieldName => $value) {
293  $queryBuilder->andWhere(
294  $queryBuilder->expr()->eq($fieldName, $queryBuilder->createNamedParameter($value, \PDO::PARAM_STR))
295  );
296  }
297 
298  $result = $queryBuilder->execute()->fetchColumn(0);
299  } catch (DBALException $e) {
300  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230770, $e);
301  }
302  return $result;
303  }
304 
313  public function ‪getRowByIdentifier(string $tableName, array $where)
314  {
315  // todo: this method is not in use, consider removing it.
316 
317  try {
318  $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
319  $queryBuilder->getRestrictions()->removeAll();
320  $queryBuilder
321  ->select('*')
322  ->from($tableName);
323 
324  foreach ($where as $fieldName => $value) {
325  $queryBuilder->andWhere(
326  $queryBuilder->expr()->eq($fieldName, $queryBuilder->createNamedParameter($value, \PDO::PARAM_STR))
327  );
328  }
329 
330  $row = $queryBuilder->execute()->fetch();
331  return is_array($row) ? $row : false;
332  } catch (DBALException $e) {
333  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230771, $e);
334  }
335  }
336 
344  public function ‪getObjectDataByQuery(QueryInterface $query): array
345  {
346  $statement = $query->getStatement();
347  // todo: remove instanceof checks as soon as getStatement() strictly returns Qom\Statement only
348  if ($statement instanceof Statement
349  && !$statement->getStatement() instanceof QueryBuilder
350  ) {
351  $rows = $this->‪getObjectDataByRawQuery($statement);
352  } else {
354  $queryParser = $this->objectManager->get(Typo3DbQueryParser::class);
355  if ($statement instanceof Statement
356  && $statement->getStatement() instanceof QueryBuilder
357  ) {
358  $queryBuilder = $statement->getStatement();
359  } else {
360  $queryBuilder = $queryParser->convertQueryToDoctrineQueryBuilder($query);
361  }
362  $selectParts = $queryBuilder->getQueryPart('select');
363  if ($queryParser->isDistinctQuerySuggested() && !empty($selectParts)) {
364  $selectParts[0] = 'DISTINCT ' . $selectParts[0];
365  $queryBuilder->selectLiteral(...$selectParts);
366  }
367  if ($query->getOffset()) {
368  $queryBuilder->setFirstResult($query->getOffset());
369  }
370  if ($query->getLimit()) {
371  $queryBuilder->setMaxResults($query->getLimit());
372  }
373  try {
374  $rows = $queryBuilder->execute()->fetchAll();
375  } catch (DBALException $e) {
376  throw new SqlErrorException($e->getPrevious()->getMessage(), 1472074485, $e);
377  }
378  }
379 
380  if (!empty($rows)) {
381  $rows = $this->‪overlayLanguageAndWorkspace($query->getSource(), $rows, $query);
382  }
383 
384  return $rows;
385  }
386 
394  protected function ‪getObjectDataByRawQuery(Statement $statement): array
395  {
396  $realStatement = $statement->getStatement();
397  $parameters = $statement->getBoundVariables();
398 
399  // The real statement is an instance of the Doctrine DBAL QueryBuilder, so fetching
400  // this directly is possible
401  if ($realStatement instanceof QueryBuilder) {
402  try {
403  $result = $realStatement->execute();
404  } catch (DBALException $e) {
405  throw new SqlErrorException($e->getPrevious()->getMessage(), 1472064721, $e);
406  }
407  $rows = $result->fetchAll();
408  } elseif ($realStatement instanceof \Doctrine\DBAL\Statement) {
409  try {
410  $realStatement->execute($parameters);
411  } catch (DBALException $e) {
412  throw new SqlErrorException($e->getPrevious()->getMessage(), 1481281404, $e);
413  }
414  $rows = $realStatement->fetchAll();
415  } else {
416  // Do a real raw query. This is very stupid, as it does not allow to use DBAL's real power if
417  // several tables are on different databases, so this is used with caution and could be removed
418  // in the future
419  try {
420  $connection = $this->connectionPool->getConnectionByName(‪ConnectionPool::DEFAULT_CONNECTION_NAME);
421  $statement = $connection->executeQuery($realStatement, $parameters);
422  } catch (DBALException $e) {
423  throw new SqlErrorException($e->getPrevious()->getMessage(), 1472064775, $e);
424  }
425 
426  $rows = $statement->fetchAll();
427  }
428 
429  return $rows;
430  }
431 
440  public function ‪getObjectCountByQuery(QueryInterface $query): int
441  {
442  if ($query->getConstraint() instanceof Statement) {
443  throw new BadConstraintException('Could not execute count on queries with a constraint of type TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Statement', 1256661045);
444  }
445 
446  $statement = $query->getStatement();
447  if ($statement instanceof Statement
448  && !$statement->getStatement() instanceof QueryBuilder
449  ) {
450  $rows = $this->‪getObjectDataByQuery($query);
451  $count = count($rows);
452  } else {
454  $queryParser = $this->objectManager->get(Typo3DbQueryParser::class);
455  $queryBuilder = $queryParser
456  ->convertQueryToDoctrineQueryBuilder($query)
457  ->resetQueryPart('orderBy');
458 
459  if ($queryParser->isDistinctQuerySuggested()) {
460  $source = $queryBuilder->getQueryPart('from')[0];
461  // Tablename is already quoted for the DBMS, we need to treat table and field names separately
462  $tableName = $source['alias'] ?: $source['table'];
463  $fieldName = $queryBuilder->quoteIdentifier('uid');
464  $queryBuilder->resetQueryPart('groupBy')
465  ->selectLiteral(sprintf('COUNT(DISTINCT %s.%s)', $tableName, $fieldName));
466  } else {
467  $queryBuilder->count('*');
468  }
469 
470  try {
471  $count = $queryBuilder->execute()->fetchColumn(0);
472  } catch (DBALException $e) {
473  throw new SqlErrorException($e->getPrevious()->getMessage(), 1472074379, $e);
474  }
475  if ($query->getOffset()) {
476  $count -= $query->getOffset();
477  }
478  if ($query->getLimit()) {
479  $count = min($count, $query->getLimit());
480  }
481  }
482  return (int)max(0, $count);
483  }
484 
492  public function ‪getUidOfAlreadyPersistedValueObject(AbstractValueObject $object): ?int
493  {
495  $dataMapper = $this->objectManager->get(DataMapper::class);
496  $dataMap = $dataMapper->getDataMap(get_class($object));
497  $tableName = $dataMap->getTableName();
498  $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
499  if ($this->environmentService->isEnvironmentInFrontendMode()) {
500  $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
501  }
502  $whereClause = [];
503  // loop over all properties of the object to exactly set the values of each database field
504  $properties = $object->_getProperties();
505  foreach ($properties as $propertyName => $propertyValue) {
506  $propertyName = (string)$propertyName;
507 
508  // @todo We couple the Backend to the Entity implementation (uid, isClone); changes there breaks this method
509  if ($dataMap->isPersistableProperty($propertyName) && $propertyName !== 'uid' && $propertyName !== 'pid' && $propertyName !== 'isClone') {
510  $fieldName = $dataMap->getColumnMap($propertyName)->getColumnName();
511  if ($propertyValue === null) {
512  $whereClause[] = $queryBuilder->expr()->isNull($fieldName);
513  } else {
514  $whereClause[] = $queryBuilder->expr()->eq($fieldName, $queryBuilder->createNamedParameter($dataMapper->getPlainValue($propertyValue)));
515  }
516  }
517  }
518  $queryBuilder
519  ->select('uid')
520  ->from($tableName)
521  ->where(...$whereClause);
522 
523  try {
524  $uid = (int)$queryBuilder
525  ->execute()
526  ->fetchColumn(0);
527  if ($uid > 0) {
528  return $uid;
529  }
530  return null;
531  } catch (DBALException $e) {
532  throw new SqlErrorException($e->getPrevious()->getMessage(), 1470231748, $e);
533  }
534  }
535 
547  protected function ‪overlayLanguageAndWorkspace(SourceInterface $source, array $rows, QueryInterface $query, int $workspaceUid = null): array
548  {
549  $context = GeneralUtility::makeInstance(Context::class);
550  if ($workspaceUid === null) {
551  $workspaceUid = (int)$context->getPropertyFromAspect('workspace', 'id');
552  } else {
553  // A custom query is needed, so a custom context is cloned
554  $context = clone $context;
555  $context->setAspect('workspace', GeneralUtility::makeInstance(WorkspaceAspect::class, $workspaceUid));
556  }
557 
558  $pageRepository = GeneralUtility::makeInstance(PageRepository::class, $context);
559  if ($source instanceof SelectorInterface) {
560  $tableName = $source->getSelectorName();
561  $rows = $this->‪resolveMovedRecordsInWorkspace($tableName, $rows, $workspaceUid);
562  return $this->‪overlayLanguageAndWorkspaceForSelect($tableName, $rows, $pageRepository, $query);
563  }
564  if ($source instanceof JoinInterface) {
565  $tableName = $source->getRight()->getSelectorName();
566  // Special handling of joined select is only needed when doing workspace overlays, which does not happen
567  // in live workspace
568  if ($workspaceUid === 0) {
569  return $this->‪overlayLanguageAndWorkspaceForSelect($tableName, $rows, $pageRepository, $query);
570  }
571  return $this->‪overlayLanguageAndWorkspaceForJoinedSelect($tableName, $rows, $pageRepository, $query);
572  }
573  // No proper source, so we do not have a table name here
574  // we cannot do an overlay and return the original rows instead.
575  return $rows;
576  }
577 
583  protected function ‪overlayLanguageAndWorkspaceForSelect(string $tableName, array $rows, ‪PageRepository $pageRepository, ‪QueryInterface $query): array
584  {
585  $overlaidRows = [];
586  foreach ($rows as $row) {
587  $row = $this->‪overlayLanguageAndWorkspaceForSingleRecord($tableName, $row, $pageRepository, $query);
588  if ($row !== null && is_array($row)) {
589  $overlaidRows[] = $row;
590  }
591  }
592  return $overlaidRows;
593  }
594 
602  protected function ‪overlayLanguageAndWorkspaceForJoinedSelect(string $tableName, array $rows, ‪PageRepository $pageRepository, ‪QueryInterface $query): array
603  {
604  // No valid rows, so this is skipped
605  if (!isset($rows[0]['uid'])) {
606  return $rows;
607  }
608  // First, find out the fields that belong to the "main" selected table which is defined by TCA, and take the first
609  // record to find out all possible fields in this database table
610  $fieldsOfMainTable = $pageRepository->‪getRawRecord($tableName, $rows[0]['uid']);
611  $overlaidRows = [];
612  foreach ($rows as $row) {
613  $mainRow = array_intersect_key($row, $fieldsOfMainTable);
614  $joinRow = array_diff_key($row, $mainRow);
615  $mainRow = $this->‪overlayLanguageAndWorkspaceForSingleRecord($tableName, $mainRow, $pageRepository, $query);
616  if ($mainRow !== null && is_array($mainRow)) {
617  $overlaidRows[] = array_replace($joinRow, $mainRow);
618  }
619  }
620  return $overlaidRows;
621  }
622 
632  protected function ‪overlayLanguageAndWorkspaceForSingleRecord(string $tableName, array $row, PageRepository $pageRepository, QueryInterface $query)
633  {
634  $querySettings = $query->getQuerySettings();
635  // If current row is a translation select its parent
636  $languageOfCurrentRecord = 0;
637  if (‪$GLOBALS['TCA'][$tableName]['ctrl']['languageField'] ?? null
638  && $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['languageField']] ?? 0
639  ) {
640  $languageOfCurrentRecord = $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['languageField']];
641  }
642  if ($querySettings->getLanguageOverlayMode()
643  && $languageOfCurrentRecord > 0
644  && isset(‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
645  && $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
646  ) {
647  $row = $pageRepository->getRawRecord(
648  $tableName,
649  (int)$row[‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']]
650  );
651  }
652  // Handle workspace overlays
653  $pageRepository->versionOL($tableName, $row, true);
654  if (is_array($row) && $querySettings->getLanguageOverlayMode()) {
655  if ($tableName === 'pages') {
656  $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
657  } else {
658  // todo: remove type cast once getLanguageUid strictly returns an int
659  $languageUid = (int)$querySettings->getLanguageUid();
660  if (!$querySettings->getRespectSysLanguage()
661  && $languageOfCurrentRecord > 0
662  && (!$query instanceof Query || !$query->getParentQuery())
663  ) {
664  // No parent query means we're processing the aggregate root.
665  // respectSysLanguage is false which means that records returned by the query
666  // might be from different languages (which is desired).
667  // So we must set the language used for overlay to the language of the current record
668  $languageUid = $languageOfCurrentRecord;
669  }
670  if (isset(‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
671  && $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
672  && $languageOfCurrentRecord > 0
673  ) {
674  // Force overlay by faking default language record, as getRecordOverlay can only handle default language records
675  $row['uid'] = $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']];
676  $row[‪$GLOBALS['TCA'][$tableName]['ctrl']['languageField']] = 0;
677  }
678  $row = $pageRepository->getRecordOverlay($tableName, $row, $languageUid, (string)$querySettings->getLanguageOverlayMode());
679  }
680  }
681  return $row;
682  }
683 
691  protected function ‪resolveMovedRecordsInWorkspace(string $tableName, array $rows, int $workspaceUid): array
692  {
693  if ($workspaceUid === 0) {
694  return $rows;
695  }
697  return $rows;
698  }
699  if (count($rows) !== 1) {
700  return $rows;
701  }
702  $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
703  $queryBuilder->getRestrictions()->removeAll();
704  $movePlaceholder = $queryBuilder
705  ->select('*')
706  ->from($tableName)
707  ->where(
708  $queryBuilder->expr()->eq('t3ver_state', $queryBuilder->createNamedParameter(‪VersionState::MOVE_PLACEHOLDER, \PDO::PARAM_INT)),
709  $queryBuilder->expr()->eq('t3ver_wsid', $queryBuilder->createNamedParameter($workspaceUid, \PDO::PARAM_INT)),
710  $queryBuilder->expr()->eq('t3ver_move_id', $queryBuilder->createNamedParameter($rows[0]['uid'], \PDO::PARAM_INT))
711  )
712  ->setMaxResults(1)
713  ->execute()
714  ->fetchAll();
715  if (!empty($movePlaceholder)) {
716  $rows = $movePlaceholder;
717  }
718  return $rows;
719  }
720 
731  protected function ‪clearPageCache(string $tableName, int $uid): void
732  {
733  $frameworkConfiguration = $this->configurationManager->getConfiguration(‪ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
734  if (empty($frameworkConfiguration['persistence']['enableAutomaticCacheClearing'])) {
735  return;
736  }
737  $pageIdsToClear = [];
738  $storagePage = null;
739 
740  // As determining the table columns is a costly operation this is done only once per table during runtime and cached then
741  if (!isset($this->hasPidColumn[$tableName])) {
742  $columns = $this->connectionPool
743  ->getConnectionForTable($tableName)
744  ->getSchemaManager()
745  ->listTableColumns($tableName);
746  $this->hasPidColumn[$tableName] = array_key_exists('pid', $columns);
747  }
748 
749  $tsfe = $this->‪getTSFE();
750  if ($this->hasPidColumn[$tableName]) {
751  $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName);
752  $queryBuilder->getRestrictions()->removeAll();
753  $result = $queryBuilder
754  ->select('pid')
755  ->from($tableName)
756  ->where(
757  $queryBuilder->expr()->eq(
758  'uid',
759  $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
760  )
761  )
762  ->execute();
763  if ($row = $result->fetch()) {
764  $storagePage = $row['pid'];
765  $pageIdsToClear[] = $storagePage;
766  }
767  } elseif (isset($tsfe)) {
768  // No PID column - we can do a best-effort to clear the cache of the current page if in FE
769  $storagePage = $tsfe->id;
770  $pageIdsToClear[] = $storagePage;
771  }
772  if ($storagePage === null) {
773  return;
774  }
775 
776  $pageTS = ‪BackendUtility::getPagesTSconfig($storagePage);
777  if (isset($pageTS['TCEMAIN.']['clearCacheCmd'])) {
778  $clearCacheCommands = ‪GeneralUtility::trimExplode(',', strtolower($pageTS['TCEMAIN.']['clearCacheCmd']), true);
779  $clearCacheCommands = array_unique($clearCacheCommands);
780  foreach ($clearCacheCommands as $clearCacheCommand) {
781  if (‪MathUtility::canBeInterpretedAsInteger($clearCacheCommand)) {
782  $pageIdsToClear[] = $clearCacheCommand;
783  }
784  }
785  }
786 
787  foreach ($pageIdsToClear as $pageIdToClear) {
788  $this->cacheService->getPageIdStack()->push($pageIdToClear);
789  }
790  }
791 
795  protected function ‪getTSFE(): ?TypoScriptFrontendController
796  {
797  return ‪$GLOBALS['TSFE'] ?? null;
798  }
799 }
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getConstraint
‪ConstraintInterface null getConstraint()
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getMaxValueFromTable
‪mixed getMaxValueFromTable(string $tableName, array $where, string $columnName)
Definition: Typo3DbBackend.php:275
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\versionOL
‪versionOL($table, &$row, $unsetMovePointers=false, $bypassEnableFieldsCheck=false)
Definition: PageRepository.php:1565
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getLimit
‪int getLimit()
‪TYPO3\CMS\Core\Context\WorkspaceAspect
Definition: WorkspaceAspect.php:31
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend
Definition: Typo3DbBackend.php:55
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getOffset
‪int getOffset()
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement\getStatement
‪string Doctrine DBAL Statement TYPO3 CMS Core Database Query QueryBuilder getStatement()
Definition: Statement.php:49
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$cacheService
‪CacheService $cacheService
Definition: Typo3DbBackend.php:66
‪TYPO3\CMS\Extbase\Persistence\QueryInterface
Definition: QueryInterface.php:29
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\overlayLanguageAndWorkspaceForSingleRecord
‪array int mixed null overlayLanguageAndWorkspaceForSingleRecord(string $tableName, array $row, PageRepository $pageRepository, QueryInterface $query)
Definition: Typo3DbBackend.php:626
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\overlayLanguageAndWorkspaceForJoinedSelect
‪overlayLanguageAndWorkspaceForJoinedSelect(string $tableName, array $rows, PageRepository $pageRepository, QueryInterface $query)
Definition: Typo3DbBackend.php:596
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\updateRelationTableRow
‪updateRelationTableRow(string $tableName, array $fieldValues)
Definition: Typo3DbBackend.php:214
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getUidOfAlreadyPersistedValueObject
‪int null getUidOfAlreadyPersistedValueObject(AbstractValueObject $object)
Definition: Typo3DbBackend.php:486
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\removeRow
‪removeRow(string $tableName, array $where, bool $isRelation=false)
Definition: Typo3DbBackend.php:253
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getRowByIdentifier
‪array bool getRowByIdentifier(string $tableName, array $where)
Definition: Typo3DbBackend.php:307
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
Definition: SourceInterface.php:22
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
Definition: DataMapper.php:52
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement
Definition: Statement.php:23
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\getRecordOverlay
‪mixed getRecordOverlay($table, $row, $sys_language_content, $OLmode='')
Definition: PageRepository.php:592
‪TYPO3\CMS\Core\Database\ConnectionPool\DEFAULT_CONNECTION_NAME
‪const DEFAULT_CONNECTION_NAME
Definition: ConnectionPool.php:50
‪TYPO3\CMS\Extbase\Object\ObjectManagerInterface
Definition: ObjectManagerInterface.php:26
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\clearPageCache
‪clearPageCache(string $tableName, int $uid)
Definition: Typo3DbBackend.php:725
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK
‪const CONFIGURATION_TYPE_FRAMEWORK
Definition: ConfigurationManagerInterface.php:29
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:52
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\addRow
‪int addRow(string $tableName, array $fieldValues, bool $isRelation=false)
Definition: Typo3DbBackend.php:132
‪TYPO3\CMS\Backend\Utility\BackendUtility\isTableWorkspaceEnabled
‪static bool isTableWorkspaceEnabled($table)
Definition: BackendUtility.php:4021
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectCountByQuery
‪int getObjectCountByQuery(QueryInterface $query)
Definition: Typo3DbBackend.php:434
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\overlayLanguageAndWorkspaceForSelect
‪overlayLanguageAndWorkspaceForSelect(string $tableName, array $rows, PageRepository $pageRepository, QueryInterface $query)
Definition: Typo3DbBackend.php:577
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\injectCacheService
‪injectCacheService(CacheService $cacheService)
Definition: Typo3DbBackend.php:94
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getSource
‪TYPO3 CMS Extbase Persistence Generic Qom SourceInterface getSource()
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectDataByRawQuery
‪array getObjectDataByRawQuery(Statement $statement)
Definition: Typo3DbBackend.php:388
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface
Definition: SelectorInterface.php:30
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$objectManager
‪ObjectManagerInterface $objectManager
Definition: Typo3DbBackend.php:74
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
Definition: SqlErrorException.php:26
‪TYPO3\CMS\Extbase\DomainObject\AbstractValueObject
Definition: AbstractValueObject.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$hasPidColumn
‪array $hasPidColumn
Definition: Typo3DbBackend.php:81
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\injectObjectManager
‪injectObjectManager(ObjectManagerInterface $objectManager)
Definition: Typo3DbBackend.php:110
‪TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig
‪static array getPagesTSconfig($id)
Definition: BackendUtility.php:698
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getStatement
‪TYPO3 CMS Extbase Persistence Generic Qom Statement getStatement()
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage
Definition: BackendInterface.php:18
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface
Definition: JoinInterface.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException
Definition: BadConstraintException.php:26
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Extbase\Service\EnvironmentService
Definition: EnvironmentService.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\resolveMovedRecordsInWorkspace
‪resolveMovedRecordsInWorkspace(string $tableName, array $rows, int $workspaceUid)
Definition: Typo3DbBackend.php:685
‪TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject\_getProperties
‪array _getProperties()
Definition: AbstractDomainObject.php:133
‪TYPO3\CMS\Core\Versioning\VersionState
Definition: VersionState.php:24
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom
Definition: AndInterface.php:16
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$environmentService
‪EnvironmentService $environmentService
Definition: Typo3DbBackend.php:70
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\getQuerySettings
‪TYPO3 CMS Extbase Persistence Generic QuerySettingsInterface getQuerySettings()
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$configurationManager
‪ConfigurationManagerInterface $configurationManager
Definition: Typo3DbBackend.php:62
‪TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
Definition: TypoScriptFrontendController.php:98
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Extbase\Service\CacheService
Definition: CacheService.php:28
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\updateRow
‪updateRow(string $tableName, array $fieldValues, bool $isRelation=false)
Definition: Typo3DbBackend.php:173
‪TYPO3\CMS\Extbase\Persistence\Generic\Query
Definition: Query.php:38
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\overlayLanguageAndWorkspace
‪array overlayLanguageAndWorkspace(SourceInterface $source, array $rows, QueryInterface $query, int $workspaceUid=null)
Definition: Typo3DbBackend.php:541
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getTSFE
‪TypoScriptFrontendController null getTSFE()
Definition: Typo3DbBackend.php:789
‪TYPO3\CMS\Core\Domain\Repository\PageRepository
Definition: PageRepository.php:52
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\getPageOverlay
‪array getPageOverlay($pageInput, $languageUid=null)
Definition: PageRepository.php:390
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface
Definition: BackendInterface.php:27
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\injectEnvironmentService
‪injectEnvironmentService(EnvironmentService $environmentService)
Definition: Typo3DbBackend.php:102
‪TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer
Definition: FrontendRestrictionContainer.php:31
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\getRawRecord
‪mixed getRawRecord($table, $uid, $fields=' *')
Definition: PageRepository.php:1269
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\getObjectDataByQuery
‪array getObjectDataByQuery(QueryInterface $query)
Definition: Typo3DbBackend.php:338
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\__construct
‪__construct()
Definition: Typo3DbBackend.php:118
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement\getBoundVariables
‪array getBoundVariables()
Definition: Statement.php:59
‪TYPO3\CMS\Core\Versioning\VersionState\MOVE_PLACEHOLDER
‪const MOVE_PLACEHOLDER
Definition: VersionState.php:72
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\$connectionPool
‪ConnectionPool $connectionPool
Definition: Typo3DbBackend.php:58
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend\injectConfigurationManager
‪injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
Definition: Typo3DbBackend.php:86