我正在使用soft-Deletable擴展名,並且所有工作都正常,除了一件事情。Symfony2 gedmo軟刪除關係檢索工作不正常
當我做了以下等於真(僞):
null == $fooRepository->findByCriteria('criteria to find deleted entity');
但以下等於false
null == $otherEntity->getDeletedFooEntity()
在那裏,當我做這個
if ($otherEntity->getDeletedFooEntity() != null)
{
$var = $otherEntity->getDeletedFooEntity()->getAnyProperty();
}
我獲得服務器500錯誤:未找到實體
我怎樣才能讓它返回null?還是我做錯了?
非常感謝
嗨亞當,你的代碼,它不是很清楚getDeletedFooEntity做什麼,因爲afaik,它不是一個symfony或教條擴展的基本行爲或幫手。 – totophe