[TYPO3-mvc] New record and pid, how to change?
Xavier Perseguers
typo3 at perseguers.ch
Sat Sep 18 17:22:46 CEST 2010
Hey Franz,
>> I know I read some post recently about this and someone that sent a
>> patch but cannot find it anymore.
>>
>> Problem: I have my plugin with a given storage folder and recursive set.
>> All works correctly however I'd like to have new "sub objects" stored in
>> same sysfolder as their aggregate. ATM they are stored on the "global"
>> sysfolder.
>>
>> IIRC there was a patch to apply to Extbase to allow pid column to be
>> manually set. Could someone enlighten me? Thanks.
>
> Does it work for you to define a "newRecordStoragePid" for each domain
> model via TS in the mapping configuration?
>
> config.tx_extbase.persistence.classes {
> Tx_YourExt_Domain_Model_FooBar {
> newRecordStoragePid = 123
> }
> }
I just figured out this (again) by reading:
http://forge.typo3.org/issues/show/369
No, unfortunately, I cannot set this statically in TS. Here is my use case:
I have companies that are stored in a sysfolder, along with users that
are related to the company and many other information. As the number of
companies is around 100-150 and they are many associated object, I
decided to create a sub-sysfolder by company :
root
`-- companies (SF)
|-- company 1 (SF)
| `-- company record and associated objects
|-- company 2 (SF)
| `-- company record and associated objects
`-- company 3 (SF)
Now, I have a plugin on some page to show all companies. I set the
storage folder being "companies" sysfolder and recursive to get all
company records.
Now, when I navigate, I may create additional associated object from the
SINGLE view of a company. Problem is that new objects are put inside
"companies" instead of the sysfolder of their corresponding aggregate
root, the company record.
Having a "pid" field in my domain model is perhaps not "DDD"-wise but I
now have to make this work. Problem is that it seems pid cannot be
mapped as any other field. In all cases, according to aforementioned
bugtracker, and quoting Sebastian:
3) The PID of INSERTED objects is determined by a TypoScript setting:
- [extensionConfiguration].classes.MODEL_CLASSNAME.newRecordStoragePid
- If this setting is empty, the first entry of the PID list used for
fetching objects is used.
Any idea?
Xavier
More information about the TYPO3-project-typo3v4mvc
mailing list