I have a query like this in a CakePHP application
// Check for txn_id
$txns = $this->$transaction_class->find('count', array(
'conditions' => array(
$transaction_class.'.txn' => $txnId
)
));
As you can see, my variable transaction_class is a dynamic variable. Form some reason this does not work. I even tried to put the variables inside {} like:
// Check for txn_id
$txns = $this->{$transaction_class}->find('count', array(
'conditions' => array(
$transaction_class.'.txn' => $txnId
)
));
But that didn't work either. Does anybody know how I can make this work please?
Thanks