Initial commit - Typo3 11.5.41

This commit is contained in:
Matteo Gallo
2026-07-03 17:53:31 +02:00
commit 5ca4743197
6811 changed files with 568848 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
namespace GeorgRinger\News\Updates;
/**
* This file is part of the "news" Extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
use GeorgRinger\News\Service\SlugService;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* Migrate empty slugs
*/
class NewsSlugUpdater implements UpgradeWizardInterface
{
const TABLE = 'tx_news_domain_model_news';
/** @var SlugService */
protected $slugService;
/**
* NewsSlugUpdater constructor.
* @param SlugService $slugService
*/
public function __construct(
SlugService $slugService
) {
$this->slugService = $slugService;
}
public function executeUpdate(): bool
{
$this->slugService->performUpdates();
return true;
}
public function updateNecessary(): bool
{
$elementCount = $this->slugService->countOfSlugUpdates();
return $elementCount > 0;
}
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class
];
}
/**
* Get title
*
* @return string
*/
public function getTitle(): string
{
return 'Updates slug field "path_segment" of EXT:news records';
}
/**
* Get description
*
* @return string Longer description of this updater
*/
public function getDescription(): string
{
return 'Fills empty slug field "path_segment" of EXT:news records with urlized title.';
}
/**
* @return string Unique identifier of this updater
*/
public function getIdentifier(): string
{
return 'newsSlug';
}
}