From 82874181b0000541c5cde05f1389769c7ca99a8b Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 8 Aug 2010 21:20:58 +0200 Subject: [PATCH] Add section on INSTANCE OF Dql Operator --- manual/en/dql-doctrine-query-language.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manual/en/dql-doctrine-query-language.txt b/manual/en/dql-doctrine-query-language.txt index 034b8b546..e0808e977 100644 --- a/manual/en/dql-doctrine-query-language.txt +++ b/manual/en/dql-doctrine-query-language.txt @@ -272,6 +272,12 @@ Get all users that have no phonenumber $query = $em->createQuery('SELECT u FROM CmsUser u WHERE u.phonenumbers IS EMPTY'); $users = $query->getResult(); +Get all instances of a specific type, for use with inheritance hierachies: + + [php] + $query = $em->createQuery('SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF Doctrine\Tests\Models\Company\CompanyEmployee'); + $query = $em->createQuery('SELECT u FROM Doctrine\Tests\Models\Company\CompanyPerson u WHERE u INSTANCE OF ?1'); + ++++ Partial Object Syntax By default when you run a DQL query in Doctrine and select only a subset of the