2014-04-07 37 views

回答

1

我不知道自己在問什麼,但是這看起來像學說的基本行爲

$student = new Student(); 
$student->setName("John doe"); 

$this->em->persist($student); 
$this->em->flush(); 

$this->printEntity($student); 
$this->em->remove($student); 
$this->em->flush(); 
$this->printEntity($student); 

這將打印出:

Student - id : "1", name : "John doe" 

Student - id : "", name : "John doe" 

行從數據庫中刪除,但你的實體仍然填充其他數據。

+0

哈!有時,推翻事物並不是最好的方式:D – Misiur

相關問題