@@ -34,8 +34,8 @@ database queries.
34
34
35
35
So this DBAL Connection objects is * our* key to running raw database queries.
36
36
Google for "Doctrine DBAL Query" so we can follow its docs. Find the
37
- [ Data Retrieval And Manipulaton] ( http://doctrine-dbal.readthedocs.org/en/latest/reference/ data-retrieval-and-manipulation.html )
38
- section. Scroll down a little to a good example:
37
+ [ Data Retrieval And Manipulaton] [ data-retrieval-and-manipulation ] section.
38
+ Scroll down a little to a good example:
39
39
40
40
``` php
41
41
$sql = "SELECT * FROM articles WHERE id = ?";
@@ -119,11 +119,15 @@ still learning it, totally use SQL. It's no big deal.
119
119
## Native Queries?
120
120
121
121
One slightly confusing thing is that if you google for "doctrine raw sql",
122
- you'll find a different solution - something called [ NativeQuery] ( http://doctrine-orm.readthedocs.org/en/latest/reference/ native-sql.html ) .
122
+ you'll find a different solution - something called [ NativeQuery] [ native-sql ] .
123
123
It sort of looks the same, just with some different function names. But there's
124
124
this ` ResultSetMapping ` thing. Huh. This ` NativeQuery ` thing allows you to
125
125
run a raw SQL query and then map that * back* to an object. That's pretty neat
126
126
I guess. But for me, if I'm writing some custom SQL, I'm fine just getting
127
127
back an array of data. I can deal with that. The ` ResultSetMapping ` confuses
128
128
me, and probably isn't worth the effort. But it's there if you want to geek
129
129
out on it.
130
+
131
+
132
+ [ data-retrieval-and-manipulation ] : https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html
133
+ [ native-sql ] : https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html
0 commit comments