[TYPO3-mvc] Extending Tx_Extbase_Domain_Model_FrontendUser

Rens Admiraal renst3 at e-rank.nl
Fri Jan 15 09:27:15 CET 2010


Hi Boris,

I've updated the member extension I posted as an example:
http://e-rank.nl/t3/T3X_member-0_0_0-z-201001150919.t3x

It now uses a Member and a Leader object. Don't try to find any logic in the 
inheritance or lists, because both will lead to the same object, with the same 
properties, in the same table... So the list views of both objects are exactly 
the same ;-)

I did not change the repositories to fetch only their own objects. It's just 
an example how you can save multiple objects in the fe_users table. You could 
also inherit from the Tx_Extbase_Domain_Model_FrontendUser object, but I do 
get an mapping error (which might be specific to my current installation, so I 
did not change that).

I hope this will help you out ;-)

Greetz,
Rens


On Thursday 14 January 2010 22:18:12 you wrote:
> Hi Rens
> 
> You mentioned in one of your earlier posts, that you're trying to save the
>  data on two tables at the same time. (your person-table and the fe_user
>  table)
> 
> As the problem below got solved, did you already master the other task? I'm
>  really interested in a solution for this. Would it be possible to share
>  this part of your code?
> 
> Cheers
> 
> Boris
> 
> Am 14.01.2010 um 14:11 schrieb Rens Admiraal:
> > The mapping has to be wrong someway, I've created a little member plugin
> > to illustrate the problem:
> > http://e-rank.nl/t3/T3X_member-0_0_0-z-201001141408.t3x
> >
> > This results in a table does not exist error, unless I change the
> > constructor of Tx_Extbase_Persistence_Mapper_DataMap in which I add the
> > following line: if ($this->tableName == 'tx_member_domain_model_member')
> > { $this-
> >
> >> setTableName('fe_users'); }
> >
> > So, somehow the $tableName parameter of the DataMap class isn't passed to
> > the constructor when I use:
> > config.tx_member {
> > 	persistence{
> > 		enableAutomaticCacheClearing = 1
> > 		updateReferenceIndex = 0
> > 		classes {
> > 			Tx_Member_Domain_Model_Member {
> > 				mapping {
> > 					tableName = fe_users
> > 					columns {
> > 						usergroup.foreignClass = Tx_Extbase_Domain_Model_FrontendUserGroup
> > 						lockToDomain.mapOnProperty = lockToDomain
> > 					}
> > 				}
> > 			}
> > 		}
> > 	}
> > }
> >
> > On Thursday 14 January 2010 13:57:25 Rens Admiraal wrote:
> >> On Thursday 14 January 2010 13:51:32 Franz Koch wrote:
> >>> Hi,
> >>>
> >>>> If inheritance does not work.
> >>>
> >>> I don't have any issues with inheritence so far - but I haven't updated
> >>> a record yet. But extending classes and remapping the tables is working
> >>> for me.
> >>
> >> How do you remap the tables?
> >>
> >>>>> and extend Tx_Extbase_DomainObject_AbstractEntity now. But it's still
> >>>>> saving all records in the wrong table... Do you have some example
> >>>>> code???
> >>>
> >>> How can they be saved in the wrong table? Therefor the "wrong" table
> >>> has to exist - but why would you have a duplicate table of fe_users?
> >>> Try to rename the table so that extbase doesn't find your duplicate and
> >>> only deal with fe_user table if you try to work with FrontendUsers.
> >>
> >> Franz: I first created the objects using the kickstarter, and changed
> >> them afterwards. This is the reason why the records is saved in the
> >> wrong table. Otherwise it would been a "table doesn't exist" error
> >>
> >> _______________________________________________
> >> TYPO3-project-typo3v4mvc mailing list
> >> TYPO3-project-typo3v4mvc at lists.typo3.org
> >> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> >
> > _______________________________________________
> > TYPO3-project-typo3v4mvc mailing list
> > TYPO3-project-typo3v4mvc at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> 


More information about the TYPO3-project-typo3v4mvc mailing list