caching - Trouble loading multiple versions of the same Doctrine_Record -


the following code snippet demonstrates peculiar behaviour doctrine.

$user = doctrine::gettable('user')->find(1); $user->name = 'zoppy';  // line prevents subsequent $user->save() working expected $old_user = doctrine::gettable('user')->find(1);  $user->save();  // not print 'zoppy' echo doctrine::gettable('user')->find(1)->name . "\n"; 

what going on here?

is there way load old version of record before executing save? seems doctrine caching somewhere -- exactly, , how turn off! (at least temporarily.)

i asked similar question recently, although phrased in terms of relationships. answer though down nature of caching in doctrine. doctrine keeping hydrated objects in memory. can clone object, follow relationships you'll square one.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -