[TYPO3-mvc] Overwriting TCA (fe_users)

Florian Staudacher florian_staudacher at yahoo.de
Wed Jul 14 15:07:42 CEST 2010


Am Mittwoch, 14. Juli 2010, 08:01:54 schrieben Sie:
> 
> This looks like you have to enter the mapping intsructions in TypoScript.
> 
my mapping, ext_typoscript_setup.txt
---code---
config.tx_extbase.persistence.classes {
	Tx_WhoozShop_Domain_Model_Customer {
		mapping {
			tableName = fe_users
			columns {
				crdate.mapOnProperty = crdate
				is_online.mapOnProperty = isOnline
				disable.mapOnProperty = disable
				deleted.mapOnProperty = deleted
				#tx_whoozshop_watchlist.mapOnProperty = watchlist
			}
		}
	}
}
---code---
> 
> Do you have specified the minItems and maxItems there too?
> 
yes,
my TCA, ext_tables.php
---code---
'watchlist' => array(
	'exclude' => 0,
	'label'   => 
'LLL:EXT:whooz_shop/Resources/Private/Language/locallang.xml:tx_whoozshop_domain_model_customer.watchlist',
	'config'  => array(
		'type' => 'select',
		'size' => 10,
		'minitems' => 0,
		'maxitems' => 99999,
		'autoSizeMax' => 30,
		'multiple' => 1,
		'default' => 0,
		'foreign_table' => 'tx_whoozshop_domain_model_product',
		'MM' => 'tx_whoozshop_customer_product_mm',
		'MM_opposite_field' => 'watched',
	)
),
...
t3lib_extMgm::addTCAcolumns('fe_users', $tmpColumns, 1);
t3lib_extMgm::addToAllTCAtypes('fe_users', 'address,credits,orders,watchlist', 
'', 'after:name');
---code---

TCA of the product, Configuration/TCA/Product.php
opposite side of the mm relation
---code---
'watched' => array(
	'exclude' => 0,
	'label' => 
'LLL:EXT:whooz_shop/Resources/Private/Language/locallang.xml:tx_whoozshop_domain_model_product.watchedBy',
	'config' => array(
		'type' => 'select',
		'size' => 10,
		'minitems' => 0,
		'maxitems' => 99999,
		'autoSizeMax' => 30,
		'multiple' => 1,
		'foreign_table' => 'fe_users',
		'MM' => 'tx_whoozshop_customer_product_mm',
	),
),
---code---

> Well, I have a crdate and the tstamp filled out. But my models extend a
> basic model in which I defined all the typo3 standard fields such as
> crdate, tstamp, sys_language_uid, pid, ... with getter and setter and I
> also defined these fields in TCA, maybe this is what you need?
... that is now my least problem :-)
I'll deal with that as soon as the relation is working.

If you need any more information, I could also send you a zipped snapshot of 
the extension...

Thanks for the help!
Florian


More information about the TYPO3-project-typo3v4mvc mailing list