analogueorm / analogue

Analogue ORM : Data Mapper ORM for Laravel/PHP
MIT License
632 stars 51 forks source link

Added value() to Query pass through methods #184

Closed hexus closed 7 years ago

hexus commented 7 years ago

This allows using ->value() on query builders to retrieve a single column value from the first result of a query.

https://laravel.com/docs/5.4/queries#retrieving-results

hexus commented 7 years ago

I've also noticed that System\Query::pluck() implementation prevents the pass through of pluck.

It behaves differently to Laravel's pluck() in 5.4, which selects all the values in a column as opposed to selecting a single value from the first row (which value() is for).

Is this intentional?

RemiCollin commented 7 years ago

No it's not intentionnal, and is certainly a leftover from 'Eloquent\QueryBuilder' the class was forked from, we should remove the 'pluck()' method and let the base query handle this.

hexus commented 7 years ago

Ah, nice! Glad I spotted it. :)