I have a problem - hope someone has a solution
I am calling a private function in the controller itself before moving to model: Expecting to insert and return the InsertId. I need the InsertId or UpdateId back to maintain other tables.
<?php private function CreateEvent($e) { $event=Event::model(); //$event = new Event; $event->ansi=$e->ansi; $event->feature_id=$e->city; $event->name=$e->event_name; ... $event->description=$e->event_desc; $id = $event->save(); echo "<pre>CreateEvent $id"; //print_r($event); die; }
It does not give me error. all SQLs shows in runtime log EXCEPT for insert.
My AR reads but does not do any DML.
Part of the log:
2009/07/02 01:37:55 [trace][system.db.ar.CActiveRecord][system.db.CDbCommand][system.web.CModule][system.web.filters.CFilterChain][system.db.CDbConnection] Executing SQL: DELETE FROM ae_session WHERE expire<1246516675
2009/07/02 01:37:55 [/s][/s][/s][/s][/s][trace][system.db.ar.CActiveRecord][system.db.CDbCommand][system.web.CModule][system.web.filters.CFilterChain][system.db.CDbConnection] Querying SQL:
SELECT data FROM ae_session
WHERE expire>1246516675 AND id='5ca42f4b4e676cfae1da69305d3cb38e'
2009/07/02 01:37:55 [/s][/s][/s][/s][/s][trace][system.db.ar.CActiveRecord][system.db.CDbCommand][system.web.CModule][system.web.filters.CFilterChain][system.db.CDbConnection] Loading "securityManager" application component
2009/07/02 01:37:55 [/s][/s][/s][/s][/s][trace][system.db.ar.CActiveRecord][system.db.CDbCommand][system.web.CModule][system.web.filters.CFilterChain][system.db.CDbConnection] Loading "statePersister" application component[/s][/s][/s][/s][/s]