【发布时间】:2014-11-16 16:15:18
【问题描述】:
我正在使用 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 类的所有实体。我的印象是所有软删除的项目都会被隐藏。有没有人有这方面的经验?
【问题讨论】:
标签: laravel-4 doctrine-orm soft-delete