Questions tagged [doctrine-query]

Doctrine Query Language (DQL) is one of the Doctrine 2 ORM key features, it is the option to write database queries in a proprietary object oriented SQL dialect.

Doctrine Query Language (DQL) is one of the Doctrine 2 ORM key features, it is the option to write database queries in a proprietary object oriented SQL dialect. Inspired by Hibernates HQL, this provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.

More about Doctrine ORM you could fine on the project site, here.

370 questions
0
votes
1 answer

Doctrine1 is removing parentheses around multiple OR conditions

I have a query that filters a list of products by a price similarity like this: $query->andWhere( '( (i.price > ? AND i.price < ?) OR (i.salePrice > ? AND i.salePrice < ?) )', array( $item->price*0.8, $item->price*1.5, …
firedev
  • 20,898
  • 20
  • 64
  • 94
0
votes
1 answer

How to use Doctrine Extension

Can anybody please say to me, how i can use Doctrine Extension? I see in DoctrineExtensions folder file Field.php, how i can use its functionality to set ORDER BY FIELD(id, 2,1,3), for example? My query: …
Nikoole
  • 4,553
  • 4
  • 18
  • 23
0
votes
1 answer

How to call stored procedure in zend1 with doctrine1

Please help me : I want to call mysql stored procedure in zend1 by doctrine1 My stored procedure is : CREATE PROCEDURE sp_test() BEGIN SELECT 'Number of records: ', count(*) from user; END// stored procedure working fine in phpMyAdmin. But…
0
votes
1 answer

Symfony 2 Doctrine:Fixtures:Load Undefined Index

I have been using Symfony2 lately, and I've been following this tutorial: tutorial.co.symblog.co.uk Unfortunately, since the tutorial was written a long time ago, many things are wrong. I've been able to fix most of them through the employment of…
xanesis4
  • 338
  • 1
  • 7
  • 15
0
votes
1 answer

SQL EXISTS condition in Symfony 1.4

I'd like to express the following sql query in Symfony 1.4 using Doctrine's Query Builder : select `user_agent` from ticket WHERE EXISTS (SELECT * FROM log WHERE ticket.id = log.ticket_id AND log.task_id = 1) How I can express…
0
votes
0 answers

Doctrine OneToOne fatal error "Maximum function nesting level ... reached"

what could be the problem? Fatal error: Maximum function nesting level of '150' reached, aborting! in http://jsfiddle.net/9faSV/
Oscar Fanelli
  • 3,337
  • 2
  • 28
  • 40
0
votes
1 answer

how to get the date from a datetime register in doctrine?

im using codeigniter with doctrine, this is my bd: id fecha_publicacion 1 2013-03-23 14:52:06 2 2013-03-23 18:02:06 3 2013-03-23 00:00:00 .. ... what i want to do, is to search those publications from a certain date or between a certain range…
Limon
  • 1,772
  • 7
  • 32
  • 61
0
votes
1 answer

Doctrine DQL, same result for 2 different query

I have a problem with Cache of Dql query, I have this 6 lines: $dql = "SELECT d, c FROM \Cms\Day d LEFT JOIN d.contents c WITH c INSTANCE OF Cms\Message ORDER BY d.num ASC"; $query = $this->_em->createQuery($dql); $result1 =…
Nicolo
  • 1
  • 3
0
votes
1 answer

Doctrine 2 - many to many join

I have two entities in many to many relation: class Foo { /** * @ORM\ManyToMany(targetEntity="Bar", inversedBy="foos") * @ORM\JoinTable(name="Foo_x_Bar") */ protected $bars; } class Bar { /** *…
Blask Poranka
  • 127
  • 1
  • 9
0
votes
1 answer

Doctrine INNER/LEFT JOIN two tables

I am learning from this Question but facing issues with many operations in between: doctrine 2 query builder and join tables Below is my Questions. I am looking for help in my previous question too.. Thanks for those who helped me in solving the…
DonOfDen
  • 3,968
  • 11
  • 62
  • 112
0
votes
0 answers

How to add "o.idempresa" to the DQL query?

I'm trying to build this query: SELECT re . *, t.tipo, m.patente, o.nombre, de.revisado FROM sdriving_registros_emisores re LEFT JOIN sdriving_turno t ON re.idturno = t.idturno LEFT JOIN sdriving_maquina_emisor me ON…
Reynier
  • 2,420
  • 11
  • 51
  • 91
0
votes
0 answers

Raw SQL query or Doctrine_Query? What is the best in performance?

I made this query in raw SQL and need some help moving to Doctrine: SELECT re . *, t.tipo, m.patente, o.nombre, de.revisado FROM sdriving_registros_emisores re LEFT JOIN sdriving_turno t ON re.idturno = t.idturno LEFT…
Reynier
  • 2,420
  • 11
  • 51
  • 91
0
votes
0 answers

More advance entity join in FormBuilder Symfony2

I have two entities. First is Clinic an second is ClinicOpeningHours. ClinicOpeningHours is mapped by Clinic id, but not in revers. I'm trying to find solution to get whole (7) records (mon - sun) and join it in ClinicFormType to have all this in…
Wolly Wombat
  • 99
  • 1
  • 1
  • 9
0
votes
1 answer

Doctrine2 :one-to-many relation;

i have 2 entity with one-to-many relation : Article & ArticleCategory class Article { /** * @var integer * * @ORM\Column(name="rate", type="integer",options={"default" : 0}) */ private $rate = 0; /** * @var \ArticleCategory * *…
parisssss
  • 803
  • 16
  • 36
0
votes
1 answer

Doctrine query optimizations

I have created a query using doctrine query builder which inserts almost 65000 rows(including all 3 tables) to 3 different tables at a time when something is performed.And for this complete process to finish it takes almost 2-3 mins to execute…
anupkumar
  • 357
  • 4
  • 14
  • 28