[TYPO3-mvc] Get content elements from a page model
Franz Koch
typo3.RemoveForMessage at elements-net.de
Mon Jan 17 18:05:57 CET 2011
Hey,
> I've ceated my own Tx_MyExt_Domain_Model_Typo3_Page model and
> as there is no separate field like 'content' in the table 'pages',
> I was wondering how to get all related recods from 'tt_content'?
>
> I see 2 possible solutions:
>
> 1.) Just define a getter and setter inside the page model and
> implement it manually using a 'tt_content' repository or
>
> 2.) Add a new field in the database which could be used by
> Extbase to populate the new property automatically.
>
> Not sure what would be the best way so, any ideas?
> What's the better solution or are there any better ones?
I think that depends on your usecase. If you intend to use it to render
your website you most likely need to differ between different content
columns and thus using getters triggering a repository or service would
make more sense to me. If it's just for managing/displaying any content
records a db-field would also be ok for me - but I'd probably stick with
dummy getters/setters and triggering a service/repository there.
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list