[TYPO3-mvc] How to manually overwrite storagePid for certain repositories?
Sebastian Kurfürst
sebastian at typo3.org
Sun May 23 09:51:12 CEST 2010
Hey Roberto,
> So my question is: Is there any way to overwrite the pid for a whole
> repository object? I'd like to define multiple storgePids within TypoScript
> and assign these to their according repositories. Therefore I would avoid
> many headaches.
Nope, that's not possible, and it won't be quickly. However, I think you
want something different: You want to *add* new records to different
storage PIDs. And that's possible.
The whole storage PID concept follows a simple set of rules, one just
needs to know it ;-)
1) Reading of objects
- If "Startingpoint" in the plugin is set, this is used as storage PID
list to read objects.
- Otherwise, If plugin.tx_[myExtension].persistence.storagePid is set,
this is used as storage PID list to read objects.
- Otherwise, If config.tx_extbase.persistence.storagePid is set, this is
used as storage PID list to read objects.
- Otherwise, 0 is used.
2) Updating of objects
- The Storage PID of existing objects is *never* changed automatically.
However, one can include a "pid" property in the domain model to move
records.
3) Creation of new objects:
- If
plugin.tx_[myExtension].persistence.classes.[fullClassName].newRecordStoragePid
is set, this is taken to store new records to.
- Otherwise, If
config.tx_extbase.persistence.classes.[fullClassName].newRecordStoragePid is
set, this is taken to store new records to.
- Otherwise, the first Page ID from 1) is used.
This may sound complex at first; but I've been thinking a lot about
this, and I think with the above rules, one can build about any layout
he wants :)
Hope this helps,
Sebastian
More information about the TYPO3-project-typo3v4mvc
mailing list