Open andrejs opened 7 years ago
Off: The custom query above is just an example, right? Because you don't need to use a custom query for that. You can execute it like this: $mapper->where(['state IN' => ['pending', 'active']]);
On: I can't say anything about the usefullness of passing through the custom param type.
Yes, it's just an example for the sake of simplicity. Intended usage of \Spot\Mapper::query()
is for custom, complex queries, where you might also have typed parameters. Currently using query()
you can't specify them, however it's supported directly by DBAL (see \Doctrine\DBAL\Connection::executeQuery
). The method just doesn't proxy them. IMHO this is unnecessary limitation of Spot.
I agree!
Needs tests, otherwise looks good to me. Valitron bug was already fixed with #217.
When using custom query, it's not possible to use custom types for query parameters. For example:
This pull request fixes the problem by passing custom param types to \Doctrine\DBAL\Connection::executeQuery() via Mapper::query().