/** * {@inheritdoc} */ public function getQueryBuilder(Segment $segment) { $converter = new SegmentQueryConverter($this->manager, $this->virtualFieldProvider, $this->doctrine, $this->restrictionBuilder); if ($this->virtualRelationProvider) { $converter->setVirtualRelationProvider($this->virtualRelationProvider); } /** @var EntityManager $em */ $em = $this->doctrine->getManagerForClass($segment->getEntity()); $qb = $converter->convert(new RestrictionSegmentProxy($segment, $em)); return $qb; }
/** * {inheritdoc} */ public function build(Segment $segment) { $converter = new SegmentQueryConverter($this->manager, $this->virtualFieldProvider, $this->doctrine, $this->restrictionBuilder); $qb = $converter->convert(new RestrictionSegmentProxy($segment, $this->doctrine->getManagerForClass($segment->getEntity()))); return $qb->getQuery(); }