[TYPO3-mvc] Cannot get findByProperty to work

Mark Kuiphuis spam at markyourweb.com
Mon Jan 2 06:42:26 CET 2012


I'm starting to like the whole Extbase/Fluid Framework, but there are tiny things I 
keep struggling with....

I have the following action in a controller:

public function statusAction() {
	$args = $this->request->getArguments();
	$transactionId = $args['transaction']; // String like: TEST05345092384
			
	$order = $this->orderRepository->findByTransactionId($transactionId);
	$this->view->assign('order', $order);
}

The field in the database is transaction_id, the variable in the model is:

protected $transactionId;

The generated SQL is: SELECT tx_travelprograms_domain_model_order.* FROM 
tx_travelprograms_domain_model_order WHERE 
tx_travelprograms_domain_model_order.transaction_id = ? AND 
tx_travelprograms_domain_model_order.deleted=0 AND 
tx_travelprograms_domain_model_order.hidden=0

If I call the findByUid(X) where X is the uid of a specific order, I do get the 
object back

Why does findByUid(X) work but not findByTransactionId($transactionId) ?

For the same matter, I also tried findByCity('Brisbane'), findByPostcode('1234')....

It seems like the ? in the SQL statement doesn't get replaced by the actual value....

If I call the static method of the extension Tx_ExtDebug::var_dump($order) in the 
statusAction I do get the following "Uncaught TYPO3 Exception"

#1210859206: Cannot return value of private property "warning.

As this must be an error I made myself (I don't believe I'm good enough to find bugs 
in software not written by myself) I hope there is someone who directly can identify 
my mistake....

Thanks :-)

Mark


More information about the TYPO3-project-typo3v4mvc mailing list