-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Making a query on Doctrine using your Library I found this error:
TypeError : Doctrine\Common\Collections\Criteria::Doctrine\Common\Collections\{closure}(): Argument #1 ($ordering) must be of type Doctrine\Common\Collections\Order|string, CodelyTv\Criteria\OrderType given
/var/www/vendor/doctrine/collections/src/Criteria.php:203
/var/www/vendor/doctrine/collections/src/Criteria.php:202
/var/www/vendor/doctrine/collections/src/Criteria.php:89
/var/www/vendor/codelytv/criteria-to-doctrine/src/CriteriaToDoctrineConverter.php:24
/var/www/src/Shared/Infrastructure/Persistence/DoctrineRepository.php:19
/var/www/tests/Integration/Blog/Post/Infrastructure/Persistence/PostDoctrineRepositoryTest.php:100
/var/www/tests/InfrastructureTestCase.php:45
/var/www/tests/InfrastructureTestCase.php:53
/var/www/tests/InfrastructureTestCase.php:53
/var/www/tests/InfrastructureTestCase.php:53
/var/www/tests/InfrastructureTestCase.php:53
/var/www/tests/InfrastructureTestCase.php:53
/var/www/tests/Integration/Blog/Post/Infrastructure/Persistence/PostDoctrineRepositoryTest.php:99
Line 63 of \CodelyTv\Criteria\Doctrine\CriteriaToDoctrineConverter
private function formatOrder(Criteria $criteria): ?array
{
if (!$criteria->hasOrder()) {
return null;
}
return [$this->mapOrderBy($criteria->order()->orderBy()) => $criteria->order()->orderType()];
}
Should be
private function formatOrder(Criteria $criteria): ?array
{
if (!$criteria->hasOrder()) {
return null;
}
return [$this->mapOrderBy($criteria->order()->orderBy()) => $criteria->order()->orderType()->value];
}
The enum OrderType is not converted to string
My version of doctrine
"doctrine/doctrine-bundle": "^2.13",
"doctrine/doctrine-migrations-bundle": "^3.4",
"doctrine/orm": "^3.3"
Metadata
Metadata
Assignees
Labels
No labels
