DDC-1100: INSTANCE OF and IN in QueryBuilder #1376

Closed
opened 2026-01-22 13:12:23 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 4, 2011).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user vrtak-cz:

I need to obtain specific entity instances. And I don't know how to write better solution for my problem

$nodes = array('Entities\FooNode', 'Entities\BarNode');

$qb->select('Entities\Node', 'n')->where("n.level = 1"); 
$classes = array(); 
foreach ($nodes as $class) { 
        $classes[] = "n INSTANCE OF " . $class; 
} 

$qb->andWhere(call*user_func*array(array($qb->expr(), 'orx'), $classes))); 
Originally created by @doctrinebot on GitHub (Apr 4, 2011). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user vrtak-cz: I need to obtain specific entity instances. And I don't know how to write better solution for my problem ``` $nodes = array('Entities\FooNode', 'Entities\BarNode'); $qb->select('Entities\Node', 'n')->where("n.level = 1"); $classes = array(); foreach ($nodes as $class) { $classes[] = "n INSTANCE OF " . $class; } $qb->andWhere(call*user_func*array(array($qb->expr(), 'orx'), $classes))); ```
admin added the New Feature label 2026-01-22 13:12:23 +01:00
admin closed this issue 2026-01-22 13:12:25 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 15, 2011):

Comment created by @guilhermeblanco:

Implemented in latest 2.2-DEV by commit: f148912a28

Cheers,

@doctrinebot commented on GitHub (Aug 15, 2011): Comment created by @guilhermeblanco: Implemented in latest 2.2-DEV by commit: https://github.com/doctrine/doctrine2/commit/f148912a28601d9c6234d59661f0e4ad1ae0c138 Cheers,
Author
Owner

@doctrinebot commented on GitHub (Aug 15, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Aug 15, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1376