我正在使用 Mitchell van Wijngaarden 的 Doctrine 解决方案(https://github.com/mitchellvanw/laravel-doctrine/wiki/Soft-Deleting)和 Laravel 4。
我已经设置了软删除,但仍然让软删除的实体出现在搜索结果中。例如,以下查询:
$group_instructions = $this->entityManager->getRepository('GroupInstruction')->findBy(array('librarian'=>$user));
即使“deleted_at”字段已填充时间戳,此查询也会返回 GroupInstruction 类的所有实体。我的印象是所有软删除的项目都会被隐藏。有没有人有这方面的经验?