1

anyone here and is familiar with Symfony2 / sonata?

I have an entity whose data differs in a flag. Archived or active.

I have to build two views. Each view displays the correct results for yourself. Unfortunately, now runs the global no longer seeking work properly because the seeking access to the DataGrid filter located in the Admins and link the fields from the entity in the query with OR.

Thus I get though for each compound from an Entity and a View the correct data, but unfortunately not in this case.

Since I have to write the query in the Admin just to get the data that are archived or still live, I got the following query from sonata.

SELECT count (DISTINCT m0_.id) AS sclr0 FROM newsitem m0_ WHERE m0_.archive =? OR m0_.headline LIKE? OR m0_.content LIKE?

But I need in my case

SELECT count (DISTINCT m0_.id) AS sclr0 FROM newsitem m0_ WHERE (m0_.headline LIKE? M0_.content OR LIKE?) AND m0_.archive =?

Does anyone here have an idea?

Xatenev
  • 6,383
  • 3
  • 18
  • 42
  • You need to do something like this with your query object http://stackoverflow.com/questions/1049617/complex-where-clauses-using-the-php-doctrine-orm – M Khalid Junaid Oct 19 '14 at 07:00

0 Answers0