Skip to content

Commit

Permalink
Removing reference to Query object before it is introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage committed Jun 17, 2010
1 parent e71f002 commit 27233af
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions manual/en/dql-doctrine-query-language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,14 @@ automatically:

Now lets run a simple query to retrieve the `Employee` we just created:

[php]
$query = $em->createQuery('select e from Entities\Employee e where e.name = ?1');
$query->setParameter('1', 'test');
[sql]
select e from Entities\Employee e where e.name = 'test'

If we check the generated SQL you will notice it has some special conditions added to
ensure that we will only get back `Employee` entities:

[php]
echo $query->getSql();

// SELECT p0_.id AS id0, p0_.name AS name1, p0_.department AS department2, p0_.discr AS discr3 FROM Person p0_ WHERE (p0_.name = ?) AND p0_.discr IN ('employee')
[sql]
SELECT p0_.id AS id0, p0_.name AS name1, p0_.department AS department2, p0_.discr AS discr3 FROM Person p0_ WHERE (p0_.name = ?) AND p0_.discr IN ('employee')

+++ Class Table Inheritance

Expand Down

0 comments on commit 27233af

Please sign in to comment.