mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-17 21:00:09 -07:00
Add findSubthemes function
This commit is contained in:
parent
5f757f9756
commit
6042c05cb0
@ -2,8 +2,21 @@
|
||||
|
||||
namespace AppBundle\Repository\Rebrickable;
|
||||
|
||||
use AppBundle\Entity\Rebrickable\Theme;
|
||||
use AppBundle\Repository\BaseRepository;
|
||||
use Doctrine\ORM\Query\Expr\Join;
|
||||
|
||||
class ThemeRepository extends BaseRepository
|
||||
{
|
||||
public function findAllSubthemes(Theme $theme) {
|
||||
|
||||
$subQueryBuilder = $this->createQueryBuilder('subtheme');
|
||||
|
||||
$queryBuilder = $this->createQueryBuilder('subtheme')
|
||||
->leftJoin(Theme::class,'theme', Join::WITH, 'subtheme.parent = theme.id')
|
||||
->where('subtheme.parent = :id')
|
||||
->setParameter('id', $theme->getId());
|
||||
|
||||
return $queryBuilder->getQuery()->getResult();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user