[TYPO3-mvc] sub-object access gives InvalidArgumentException

"Christian Müller (Kitsunet)" christian at kitsunet.de
Wed Jun 16 21:56:11 CEST 2010


So, I probably miss something very easy, but I went over it again and 
again and don't see it...

In my template I try:
{reference.customer.company} and get InvalidArgumentException

{reference.customer} only gives me the customer uid...

I have a table tx_knmvcdb_domain_model_reference field customer defined 
like that in TCA:

		'customer' => array (
			'exclude' => 1,
			'label' => 
'LLL:EXT:knmvcdb/locallang_db.xml:tx_knmvcdb_domain_model_reference.customer',
			'config' => array (
				'type' => 'select',
				'allowed' => 'tx_knmvcdb_domain_model_customer',
				'maxitems' => 1,
			)
		),


In Tx_Knmvcdb_Domain_Model_Reference:


...snip...

	/**
	 * @var Tx_Knmvcdb_Domain_Model_Customer
	 */
	protected $customer;

...snip...

	/**
	* Set the Customer value
	* @param Tx_Knmvcdb_Domain_Model_Customer $param_Customer
	*/
	public function setCustomer(Tx_Knmvcdb_Domain_Model_Customer 
$param_Customer ) {
		$this->customer = $param_Customer;
	}

	/**
	* Returns the Customer value.
	* @return Tx_Knmvcdb_Domain_Model_Customer
	*/
	public function getCustomer() { return $this->customer; }

...snip...


And of course Tx_Knmvcdb_Domain_Model_Customer exists with a property 
$company and

...snip...

	/**
	* Returns the Company value.
	* @return string
	*/
	public function getCompany() {
		return $this->company;
	}

...snip...

So at what point am I missing the configuration magic to have the 
customer object instead of uid only...

I can use the respective repositories just fine and render eg. a list of 
all existing customers (with company name - the company property), so 
that makes me believe that my models can't be that bad... but obviously 
something is wrong.

I am using ExtBase 1.0.2 and fluid 1.0.2 as shipping with TYPO3 4.3.3.

Thanks,
Christian


More information about the TYPO3-project-typo3v4mvc mailing list