Skip to content

Commit

Permalink
Convert primaryKey value to int if it is numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk authored and paveljanda committed May 20, 2021
1 parent 632ae20 commit eeaeae6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DataSource/DoctrineCollectionDataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public function getData(): array
public function filterOne(array $condition): IDataSource
{
foreach ($condition as $column => $value) {
if ($column === $this->primaryKey && is_numeric($value)) {
$value = (int) $value;
}

$expr = Criteria::expr()->eq($column, $value);
$this->criteria->andWhere($expr);
}
Expand Down

0 comments on commit eeaeae6

Please sign in to comment.