-
Notifications
You must be signed in to change notification settings - Fork 18
[FEATURE] Centralize TCA to allow modification, resolves #382 #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FEATURE] Centralize TCA to allow modification, resolves #382 #383
Conversation
|
Example usage: services:
_defaults:
autowire: true
autoconfigure: true
public: false
Vendor\ExtName\Import\DynamicTcaRepository:
decorates: Cobweb\ExternalImport\Domain\Repository\TcaRepositoryInterface
public: truePHP Class: <?php
namespace Vendor\ExtName\Import;
use Cobweb\ExternalImport\Domain\Repository\TcaRepositoryInterface;
use TYPO3\CMS\Core\Database\ConnectionPool;
final readonly class DynamicTcaRepository implements TcaRepositoryInterface
{
public function __construct(
private TcaRepositoryInterface $parent,
private ConnectionPool $connectionPool,
) {
}
public function getTca(): array
{
$tca = $this->parent->getTca();
// Do some magic via database
return $tca;
}
} |
3acb0aa to
39e5346
Compare
|
Hi. I'm finally taking the time to look seriously at your PR. I also needed to read more about the Schema API first, since you hinted that your proposed change could ease switching to the Schema API later. I'm basically okay with your change. I would rather go the way of introducing a PSR-14 event for changing the TCA. I think DI is poorly understood (including by myself, in part because - my judgment - the documentation about that part is not helpful). I'm wondering if the repository should really be so simple, of if it should include more precise methods, like And related to the Schema API, as it stands and if I understand correctly, it would not be usable in External Import, because it would not make it possible to access the "external" configuration. The Schema API exposes only selected parts of the TCA. Is this also how you understand the situation? |
Thanks for looking into that. I highly appreciate a proper preparation with a working concept instead of a fast implementation that needs to be changed over and over again. I didn't have a closer look into Schema API yet. But it should be read only. The extension itself would need something else in order to allow modification of the configuration. Still a single location for accessing the systems configuration should make it easier.
I'm fine with either DI or PSR-14 approach. I'd leave it up to you as maintainer of the extension.
I guess that would be a good idea. Another one would be to turn the Class into a Factory that will trigger the event. The factory can return an internal object with proper API. That way the extension is independent of concrete TYPO3 concepts.
That might be the case right now, I'm not too much into that topic. It might be possible to open the API in the future. But I also could imagine that it should be kept that small to not be bloated again. I hope those comments and ideas are helpful. |
|
Thanks for your answer. It will help me move forward. I also mean to check with the Core Team what their plan is with the Schema API, but - as you said - if the code is well wrapped, it does not matter so much. |
Resolves: #382