TYPO3 CMS  TYPO3_7-6
AbstractDatabaseSchemaUpdate.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
25  protected $title;
26 
31 
36 
40  protected $objectManager;
41 
45  public function __construct()
46  {
47  $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
48  $this->schemaMigrationService = $this->objectManager->get(\TYPO3\CMS\Install\Service\SqlSchemaMigrationService::class);
49  $this->expectedSchemaService = $this->objectManager->get(\TYPO3\CMS\Install\Service\SqlExpectedSchemaService::class);
50  }
51 
57  protected function getDatabaseDifferences()
58  {
59  $expectedSchema = $this->expectedSchemaService->getExpectedDatabaseSchema();
60  $currentSchema = $this->schemaMigrationService->getFieldDefinitions_database();
61 
62  // Difference from expected to current
63  return $this->schemaMigrationService->getDatabaseExtra($expectedSchema, $currentSchema);
64  }
65 }