我正在使用 soft-Deletable 扩展,一切正常,除了 1 件事。
当我做以下等于真(伪代码):
null == $fooRepository->findByCriteria('criteria to find deleted entity');
但以下等于假
null == $otherEntity->getDeletedFooEntity()
当我这样做时
if ($otherEntity->getDeletedFooEntity() != null)
{
$var = $otherEntity->getDeletedFooEntity()->getAnyProperty();
}
我收到服务器 500 错误:找不到实体
我怎样才能使它返回null?还是我做错了?
非常感谢