1
0
mirror of synced 2024-12-15 15:46:02 +03:00

Add section on INSTANCE OF Dql Operator

This commit is contained in:
Benjamin Eberlei 2010-08-08 21:20:58 +02:00
parent 9fa64adbda
commit 82874181b0

View File

@ -272,6 +272,12 @@ Get all users that have no phonenumber
$query = $em->createQuery('SELECT u FROM CmsUser u WHERE u.phonenumbers IS EMPTY'); $query = $em->createQuery('SELECT u FROM CmsUser u WHERE u.phonenumbers IS EMPTY');
$users = $query->getResult(); $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 ++++ Partial Object Syntax
By default when you run a DQL query in Doctrine and select only a subset of the By default when you run a DQL query in Doctrine and select only a subset of the