News for hackers. Stuff that matters.
Re:The Last PHP PDO Library You Will Ever Need by Ramone on Friday November 04, 2011 @08:19AM (#3195749)
It's really all about factoring. You'll notice now that you have model logic in your controller. If you want to reuse that elsewhere, you'll first have to extract it to another class. That class is effectively a SQL generation library, except it's not useful in a general sense and it's not as well tested. The more you do this, the more you converge on reinventing a full blown ORM.

I'm not saying there aren't downsides to ORMs, but the counter-arguments to SQL in your controller are pretty obvious.

Re:The Last PHP PDO Library You Will Ever Need by wvenable on Friday November 04, 2011 @12:10PM (#3196571)
I disagree. Yes, this should be refactored and placed in a model; but that would be something like Clients::getReadMetrics() that would contain the same SQL. I don't see that heading towards a full ORM or even remotely like SQL generation.