[TYPO3-mvc] Using existing database tables in a model
Andreas Kießling
andreas.kiessling at web.de
Wed Apr 21 09:39:56 CEST 2010
Hi Mario,
are you using current svn version of extbase? Then you might have a look
at the "single table inheritance" threads. tt_news has a type field to
distinguish between regular news, pages and external url and so extbase
currently adds someting like "and type = your_class_name" if no specific
type is set in typoscript.
Regards,
Andreas
Am 21.04.10 09:19, schrieb Mario Beiser:
> In article<mailman.10057.1271785163.610.typo3-project-
> typo3v4mvc at lists.typo3.org>, dennis.ahrens at googlemail.com says...
>>
>> Hi Mario,
>>
>> i've implemented something like this for sys_lockedrecords. In this
>> case there was a problem with a not contained pid-field. But in
>> general you just have to do the typoscript mapping and thats it.
>>
>> regards
>> Dennis
>>
>> 2010/4/20 Mario Beiser<mariobeiser at googlemail.com>:
>>> Hi there,
>>>
>>> just tried to have some output of an existing database table in a
>>> projekt like e.g. tt_news.
>>>
>>> Therefore I used a a mapping like it is done in the extbase core for
>>> frontend users. When I try to print out my frontend user everything
>>> works fine.
>>>
>>> My question is, how it is possible to have existing tables as a base for
>>> a model class? Just the same way the frontend user thing in the
>>> Extbase-Extension is done?
>>>
>>> So the typoscript-mapping is all I have to do?
>>>
>>> Perhaps someone has done this before.
>>> Regards
>>> Mario
>>>
>>> _______________________________________________
>>> TYPO3-project-typo3v4mvc mailing list
>>> TYPO3-project-typo3v4mvc at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>>>
>
> Hi Dennis,
>
> here is my example config:
>
> config.tx_test {
> persistence{
> enableAutomaticCacheClearing = 1
> updateReferenceIndex = 0
> classes {
> Tx_Test_Domain_Model_News {
> mapping {
> tableName = tt_news
> }
> }
> }
> }
> }
>
> I can't see any error here, atm there is no output of the news...
> When I understood your message correctly, this mapping should work.
> Shouldn't it?
>
> Regards
> Mario
>
>
More information about the TYPO3-project-typo3v4mvc
mailing list