Re: My contribute do DB/common.php - getMany()
| From: | Johann | Date: | Wed, 10 Jul 2002 13:54:52 +0000 |
| Subject: | Re: My contribute do DB/common.php - getMany() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7633@lists.php.net to get a copy of this message | ||
On 10 lipca 2002 at 14:59:33
Lukas Smith <smith@dybnet.de>
wrote:
> Well this is yet another "high level" method that does not add any
> functionality but safes a bit of work for a programmer.
Paging results is a very common task for web programmers. I am using
getAll(), getOne() very often to became my code shorter and simpler.
Many programmers need paging capabilities and there was no easy
high-level solution for PHP. When I looked at excelent abstract of
Python API I found it has very simple solution. It has cursor with
methods fetchOne(), fetchAll() and fetchMany(). PHP has similar
getOne(), getAll(), but no getMany(). So it seems logical to add it.
> I did some fairly crude testing and it seems like these types of methods
> don't really add much overhead. They do however make the API larger and
> mean that more code needs to be maintained (although these type of
> methods don't need all that much more since they are the same for all
> RDBMS).
If we do not want to increase code, older getAll() method can be
removed with my method which is more universal.
> The question is more if we want more of these methods to be part of PEAR
> DB/MDB or if they should be moved to a separate package.
For backward compatibility it would be better to leave it as
they are.
--
Johann