Saving Ar Object Between Requests


What is the best way to save AR object between requests without saving it to DB?

What I want

Request 1

$item = Items::model()->finsByPk($id);

Request 2

$item->some_property = x; // with some internal business logic, some fields changes

Request 3

$item->another_property = y;

Request 4

here i want to be able to do or


or just clear the object and left corresponding database record unchanged

I’ve tried to save it to the session like this



Yii::app()->session[‘item’] = $item;

All is goig fine untill i try to save it to db. After save method i’m getting Access violation errors in my php process.

So what is the best solution in this situation?

[size=2]First, this is not the forum for this kind of question. I guess the admins will soon move it to the right forum ("General v1.x questions"…).[/size]

[size=2]To your question, see the short example on how to use CHttpSession on its api documentation page.[/size]

Oops. Sorry for my mistake. I saw the title “Web Application Development With Yii And PHP” but haven’t noticed “Yii Books Discussion”. My topic must be deleted at all, because my session code is ok. As I’ve found out my PDO library is the memory corruption reason.