TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\DataHandling\Event;
|
||||
|
||||
/**
|
||||
* Event fired so listeners can intercept add elements when checking links within the SoftRef parser
|
||||
*/
|
||||
final class AppendLinkHandlerElementsEvent
|
||||
{
|
||||
private bool $isResolved = false;
|
||||
|
||||
public function __construct(
|
||||
private array $linkParts,
|
||||
private string $content,
|
||||
private array $elements,
|
||||
private readonly int $idx,
|
||||
private readonly string $tokenId
|
||||
) {}
|
||||
|
||||
public function getLinkParts(): array
|
||||
{
|
||||
return $this->linkParts;
|
||||
}
|
||||
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function getElements(): array
|
||||
{
|
||||
return $this->elements;
|
||||
}
|
||||
|
||||
public function getIdx(): int
|
||||
{
|
||||
return $this->idx;
|
||||
}
|
||||
|
||||
public function getTokenId(): string
|
||||
{
|
||||
return $this->tokenId;
|
||||
}
|
||||
|
||||
public function setLinkParts(array $linkParts): void
|
||||
{
|
||||
$this->linkParts = $linkParts;
|
||||
}
|
||||
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function setElements(array $elements): void
|
||||
{
|
||||
$this->elements = $elements;
|
||||
}
|
||||
|
||||
public function addElements(array $elements)
|
||||
{
|
||||
$this->elements = array_replace_recursive($this->elements, $elements);
|
||||
$this->isResolved = true;
|
||||
}
|
||||
|
||||
public function isResolved(): bool
|
||||
{
|
||||
return $this->isResolved;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\DataHandling\Event;
|
||||
|
||||
/**
|
||||
* Event is dispatched before non-copyable fields are removed from a record. Listener can modify the list of
|
||||
* non-copyable fields (e.g. add custom fields, which should be ignored by DataHandler during copy/localization).
|
||||
*
|
||||
* @internal This event should only be used by experienced developers who understand the implications of
|
||||
* DataHandler's field processing. Wrong usage will lead to data inconsistencies. The event is
|
||||
* therefore declared as "use at your own risk, may change without notice".
|
||||
*/
|
||||
final class BeforeRemoveNonCopyableFieldsEvent
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $table,
|
||||
private readonly array $row,
|
||||
private readonly string $callingOperation,
|
||||
private array $nonCopyableFields
|
||||
) {}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function getCallingOperation(): string
|
||||
{
|
||||
return $this->callingOperation;
|
||||
}
|
||||
|
||||
public function getRow(): array
|
||||
{
|
||||
return $this->row;
|
||||
}
|
||||
|
||||
public function getNonCopyableFields(): array
|
||||
{
|
||||
return $this->nonCopyableFields;
|
||||
}
|
||||
|
||||
public function setNonCopyableFields(array $nonCopyableFields): void
|
||||
{
|
||||
$this->nonCopyableFields = $nonCopyableFields;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace TYPO3\CMS\Core\DataHandling\Event;
|
||||
|
||||
use Psr\EventDispatcher\StoppableEventInterface;
|
||||
|
||||
/**
|
||||
* Event to intercept if a certain table should be excluded from the Reference Index.
|
||||
* There is no need to add tables without a definition in $GLOBALS['TCA'] since
|
||||
* ReferenceIndex only handles those.
|
||||
*/
|
||||
final class IsTableExcludedFromReferenceIndexEvent implements StoppableEventInterface
|
||||
{
|
||||
private bool $isExcluded = false;
|
||||
|
||||
public function __construct(private readonly string $table) {}
|
||||
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
|
||||
public function markAsExcluded()
|
||||
{
|
||||
$this->isExcluded = true;
|
||||
}
|
||||
|
||||
public function isTableExcluded(): bool
|
||||
{
|
||||
return $this->isExcluded;
|
||||
}
|
||||
|
||||
public function isPropagationStopped(): bool
|
||||
{
|
||||
return $this->isTableExcluded();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user