[TYPO3-mvc] Property / relation problem

Alexander Dick typo3 at dick.at
Thu Feb 2 16:24:30 CET 2012


Hi everyone!

I am currently having a problem with a relation, I think the problem is 
that the property $country does contain the country code (DE, AT, CH, 
...) rather than the UID of the foreign record.

I chose the country code for consistency reasons - if you update the 
static_info_tables it may be that the UIDs change and I have wrong 
relations afterwards.

Essentially the models look like this:

class Tx_Xxx_Domain_Model_User extends 
Tx_Extbase_Domain_Model_FrontendUser {

	/**
	 * Country with static info table code
	 *
	 * @var Tx_Xxx_Domain_Model_StaticCountry
	 */
	protected $country;

}


class Tx_Xxx_Domain_Model_StaticCountry extends 
Tx_Extbase_DomainObject_AbstractEntity {
	
	/**
	 * Country code
	 *
	 * @var string
	 */
	protected $cnIso2;

	.
	.
	.
}


Now $user->getCountry() of course doesn't return anything because it 
searches 'DE' in the static_countries UID field instead of cn_iso_2 I 
suppose.

How can I map it to cn_iso_2?

I have played around in TS configuration with foo.mapOnProperty but no 
success so far.

Also I don't have any TCA configuration for Tx_Xxx_Domain_Model_User 
(not needed because they are essentially fe_users records) where I could 
set a foreign_field.

Thanks!
Alex


More information about the TYPO3-project-typo3v4mvc mailing list