It looks like a big mess,how does it work as reference?
http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language%3Abnf
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think it’s used as a reference by any human-being, actually ; but it might be useful if someone want to use some automatic tool that understands BNF ; for instance, some kind of code generator.
The advantage of BNF being that’s it’s a formal way to describe a language — much more easier to understand than english, when you are a program.
For reference :
Edit after the comments : Here’s a quick example about the DQL / Object stuff :
Let’s consider this portion of code, which is using the object-oriented API to write a query, execute it, and get the results (hydrated as arrays — prints out only the data, this way, when debugging) :
And here’s the kind of output you’ll get :
Of course, this is considering the schema and models classes are OK — and sorry for the example in french, I used a schema/model/database I set up some time ago for a demonstration of Doctrine, which was in french.
Basically, the DB is for a blogging application, and, here, we :
Now, here’s an equivalent, using what I meant by “DQL” as in “pseudo-SQL language” :
No object-oriented API here (well, to write the query, I mean) : I only wrote that pseudo-SQL I was thinking about — which is what the BNF describes, as far as I can tell.
And, of course, the output of the
var_dumpis exactly the same as the one I got before.I hope this makes things a bit more clear 🙂