DDC-1493: Improving in() from ExpressionBuilder #1873

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

Originally created by @doctrinebot on GitHub (Nov 15, 2011).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user h-andreas:

Instead of this piece of code:

$literal = $expr->literal($v);
$expr->andX(
  $expr->eq('at.key', $expr->literal($k)),
  $expr->orX(
    $expr->eq('a.valueInt', $literal),
    $expr->eq('a.valueText', $literal),
    $expr->eq('a.valueDate', $literal)
  )
);

I would like to simplify my query by using this syntax:

$expr->andX(
  $expr->eq('at.key', $expr->literal($k)),
  $expr->in($expr->literal($v), array('a.valueInt', 'a.valueText', 'a.valueDate'))
);
Originally created by @doctrinebot on GitHub (Nov 15, 2011). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user h-andreas: Instead of this piece of code: ``` $literal = $expr->literal($v); $expr->andX( $expr->eq('at.key', $expr->literal($k)), $expr->orX( $expr->eq('a.valueInt', $literal), $expr->eq('a.valueText', $literal), $expr->eq('a.valueDate', $literal) ) ); ``` I would like to simplify my query by using this syntax: ``` $expr->andX( $expr->eq('at.key', $expr->literal($k)), $expr->in($expr->literal($v), array('a.valueInt', 'a.valueText', 'a.valueDate')) ); ```
admin added the ImprovementWon't Fix labels 2026-01-22 13:29:13 +01:00
admin closed this issue 2026-01-22 13:29:14 +01:00
Author
Owner

@malukenho commented on GitHub (Jan 3, 2017):

@Ocramius I think it need further discussion as it'll provide a new api. I think that it belongs to 3.x milestone

@malukenho commented on GitHub (Jan 3, 2017): @Ocramius I think it need further discussion as it'll provide a new api. I think that it belongs to `3.x` milestone
Author
Owner

@lcobucci commented on GitHub (Jan 3, 2017):

@malukenho @Ocramius I'd say that we should simply use DQL or the QueryBuilder for that. It seems that nobody is really missing this since Nov 2011.

@lcobucci commented on GitHub (Jan 3, 2017): @malukenho @Ocramius I'd say that we should simply use DQL or the `QueryBuilder` for that. It seems that nobody is really missing this since Nov 2011.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1873