Closed Nyl000 closed 9 years ago
try andWhere
olekhy: it doesn't work. Same request generated, same result :s
Ok, solved this by passing the source in the table constructor..
//in controller:
$table = new ProductTable($this->getTranslator(), $queryBuilder);
//in table class:
function __construct(Translator $translator, $queryBuilder = null) { // .... $this->setSource($queryBuilder); // .... }
So the problem is when the setSource method si called I guess..
Here is my code:
$id = (int) $this->params()->fromRoute('id', 0); $queryBuilder = $this->getEntityManager()->createQueryBuilder() ->add('select', 'q') ->add('from', $this->entityNamespace . ' q') ->leftJoin('q.customersInfos', 'b') ->leftJoin('b.customer', 'c') ->where('c.id = '.$id);
(a $query->getQuery()->getSQL() typed in phpmyadmin work as I want, but the table always show all my product table..)
Any ideas ??