1
次のコードスニペットはDoctrineのいくつかの特殊な動作を示しています。同じDoctrine_Recordの複数バージョンの読み込みに問題があります
$user = Doctrine::getTable('User')->find(1);
$user->name = 'Zoppy';
// This line prevents the subsequent $user->save() from working as expected
$old_user = Doctrine::getTable('User')->find(1);
$user->save();
// Does not print 'Zoppy'
echo Doctrine::getTable('User')->find(1)->name . "\n";
ここでは何が起こっていますか?
保存を実行する前に古いバージョンのレコードを読み込む方法はありますか? Doctrineはどこかに何かをキャッシングしているようです。正確にはどういうものなのでしょうか? (少なくとも一時的に)