Skip to content

[BC break] Cannot use string for filtering DateTime column #729

Open
@mskocik

Description

@mskocik

With this property definition:

/**
 * @property DateTimeImmutable $created
 */ 
class MyEntity extends Entity {}

Following code throws error Modifier %?ldt expects value to be DateTimeInterface, string given.

$myEntityRepository->findBy([
  'created>' => '2025-01-01'
]);

This condition is allowed in v4. I believe this should also be allowed for datetime columns. Especially when it's valid SQL.

/**
 * @property int $myIntProp
 */ 
class MyEntity extends Entity {}

$myEntityRepository->findBy([
  'myIntProp' => '12'
]);

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions