Save doctrine record without persisting

canepos

New Member
within my Unit-tests i would like to have the following behavior:\[code\]$myNewDoctrineRecord = new Dto_MyRecord();$myNewDoctrineRecord->pk = 1; //the primary key...$myNewDoctrineRecord->save();\[/code\]Now this record shouldnt really persist to the database. But i would like to do\[code\]$myFetchedDoctrineRecord = Doctrine::getTable('Dto_MyRecord')->find(1);//result should be $myFetchedDoctrineRecord === $myNewDoctrineRecord\[/code\]I know this could be achived with a DAO pattern, where i replace the DAO to some mock. But maybe there is some possibility so just say Doctrine not to persist, but only to "remember" the records.Thank you!Markus
 
Back
Top