It's been said many times that PDO is not an abstraction layer, it's more of a unified interface, however, having PDO::query() always return a PDOStatement object means that any abstraction that uses PDO will either a) have to use PDOStatement as it's result set object (which while fine for the most part, kind of defeats the idea that PDO is not an abstraction layer) or b) create it's own result set object and populate it from the returned PDOStatement result set. Option "b" is somewhat of a waste since it involves the instantiation of two objects for the same purpose.
What I'm proposing is to allow PDO::query() to return a subclass of PDOStatement. This would allow abstractions to tailor the result set to their own needs while not (in theory) being too complicated to implement.
My initial idea involves passing an object that is a subclass of PDOStatement into PDO:query as a second parameter, then all that would be needed to get it to return a custom result set would be something like this:
$results = $conn->query($sql,new ResultSet());
If I knew C, I'd write a patch for this, but since I don't, I thought I'd at least suggest this.
---------------- Nicholas Telford
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php