Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed passing DateTime instances into DoctrineDatabase::findBy() methods #22

Open
wants to merge 5 commits into
base: 4.6
Choose a base branch
from

Conversation

Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Nov 20, 2024

🎫 Issue IBX-XXXXX

Description:

This PR aims to fix an issue where specific types representing database values - namely, DateTimeInterface in context of Doctrine DBAL date & time types - are not working properly.

This allows for example:

$gateway->findBy(['date' => new DateTimeImmutable('2025-01-01 00:00:00']),

as well as using Comparison operators with date time objects, without formatting them explicitly in the gateway/handler.

use Doctrine\Common\Collections\Expr\Comparison

$gateway->findBy([new Comparison('field', '>', new DateTimeImmutable('2025-01-01 00:00:00'))]),

Reported deprecations are due to Doctrine internal calls, which we are mocking during tests.

For QA:

Documentation:

@adamwojs adamwojs force-pushed the fix-date-time-find-by branch from 9f48398 to 2c48633 Compare February 2, 2025 11:47
@Steveb-p Steveb-p marked this pull request as ready for review February 11, 2025 12:17
@Steveb-p Steveb-p requested a review from a team February 11, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants