This is my code:
$ptoRequests = CalendarRequest::model()
->with(array('intervals'))
->findAll(array('order' => 't.time, t.id desc',
'condition' => 'eventId in (5, 7, 8, 9, 10, 11) and statusId in (1,2) and userId = "' . $user->userId . '" and (intervals.enddate >= :from)',
'params' => array('from' => date("Y-m-d"))));
echo "<pre>"; var_dump($ptoRequests->getQuery()); echo "</pre>"; exit();
What I want to achieve is to print the last query executed. The getQuery() function returns me a fatal error. What should I do ? Thx