[TYPO3-mvc] [FYI] Autopopulation of PID - or: Where should my records be placed?

Sebastian KurfŸürst sebastian at typo3.org
Fri Jul 31 10:10:46 CEST 2009


Hey,

I just wanted to tell you that I've just committed a solution to 
http://forge.typo3.org/issues/show/3698#note-15 (in Revision 993)

I've been thinking a lot how to deal with PIDs, and how to determine 
where records are fetched from and where they should be stored to.


Here's a wrapup of three guidelines which should fully explain PID handling:


1) For FETCHING objects, a configurable list of pages is used.
   - This list is configurable inside the FE plugin options
     (startingpoint).
   - If that is empty, fall back to "General record storage page" of the
     current page.
   - If empty, fall back to the storage PIDs of the website.
     (getStorageSiterootPids).

2) PIDs of UPDATED objects are never changed by the system.
Of course, you can include a "pid" property inside your domain model and 
thus change the PID explicitely.

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.

NOTE: It is the user's responsibility that all added records are 
fetchable as well.

THIS CHANGE BREAKS BACKWARDS COMPATIBILITY: If no storage PID is 
explicitely defined, the method "getStorageSiterootPids" is used. 
(Before, it used the current page.)


Please tell me any comments! I do not regard this 100% as stable yet, so 
if, f.e. you have comments concerning the naming or behavior, please 
tell me :-)

Greets,
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list