0
我的问题在很大程度上取决于这一点:Doctrine: Query only where relationship doesn't exist?找到所有实体没有关系
我不知道同样的事情可以用Doctrine2完成。我对良好的做法特别感兴趣。我必须使用QueryBuilder
还是可以在存储库上使用findBy
?
我的问题在很大程度上取决于这一点:Doctrine: Query only where relationship doesn't exist?找到所有实体没有关系
我不知道同样的事情可以用Doctrine2完成。我对良好的做法特别感兴趣。我必须使用QueryBuilder
还是可以在存储库上使用findBy
?
最后,我使用(从上述链接的问题的例子)QueryBuilder
这样的:
// $entitiyManager: Doctrine EntityManager instance
$qb = $entityManager->createQueryBuilder();
$x = $qb->expr();
$qb->select('article')
->from('Article', 'article')
->leftJoin('article.category', 'category')
->where($x->isNotNull('category.id');