/** * Constructor. * * @param Repository $repository */ public function __construct(Repository $repository) { $this->repository = $repository; $this->manager = $repository->getManager(); $this->metadata = $repository->getMetadata(); $this->query = $this->manager->getConnection()->createQueryBuilder()->from($this->metadata->getTable()); }
/** * Constructor. * * @param EntityManager $manager * @param Metadata $metadata */ public function __construct(EntityManager $manager, Metadata $metadata) { $this->manager = $manager; $this->metadata = $metadata; $this->query = $manager->getConnection()->createQueryBuilder()->from($metadata->getTable()); }