orm icon indicating copy to clipboard operation
orm copied to clipboard

Add BETWEEN() expr.

Open frag-seb opened this issue 7 years ago • 4 comments

The PullRuest added one BETWEEN class and a new method for NOT BETWEEN.

#6450 here example for this issues

between and function

$queryBuilder
            ->where(
                $queryBuilder->expr()->between('CURRENT_TIMESTAMP()', ':min', ':max')
            )
            ->setParameter('min', '2018-04-10 10:19:37')
            ->setParameter('max', '2018-04-12 10:19:37')
        ;

not between and mysql function (The mysql function can not use as parameter)

$queryBuilder
            ->where(
                $queryBuilder->expr()->between('CURRENT_TIMESTAMP()', ':min', ':max')
            )
            ->setParameter('min', '2018-04-10 10:19:37')
            ->setParameter('max', '2018-04-12 10:19:37')
        ;

with orX and between

$queryBuilder
            ->where(
                $queryBuilder->expr()->orX(
                    $queryBuilder->expr()->isNull('user.firstName'),
                    $queryBuilder->expr()->between(':val', 1, 10)
                )
            )
            ->setParameter('val', 5)
        ;

frag-seb avatar Apr 10 '18 09:04 frag-seb

We're doing some housekeeping on the 3.0.0 milestone. Since nobody seems to be actively working on this topic I'm removing this PR from the 3.0.0 milestone. I you want to pick up the work, please target the ORM's next feature release (currently 2.13.0) instead.

derrabus avatar May 11 '22 09:05 derrabus

@frag-seb would it be possible to target a 2.x version for this PR?

It would resolve this bug https://github.com/doctrine/orm/issues/6450

holtkamp avatar Aug 02 '23 10:08 holtkamp

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Jan 03 '25 03:01 github-actions[bot]

As mentioned in https://github.com/doctrine/orm/pull/7184#issuecomment-1661986993, I think it is still useful to resolve https://github.com/doctrine/orm/issues/6450

holtkamp avatar Jan 03 '25 12:01 holtkamp

There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. If you want to continue working on it, please leave a comment.

github-actions[bot] avatar Apr 15 '25 03:04 github-actions[bot]

This pull request was closed due to inactivity.

github-actions[bot] avatar Apr 23 '25 03:04 github-actions[bot]