RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I don't know much about PDO, but in raw MySQL SQL you'd have something > similar to this... > > function Select($table, $where, $page = false, $perpage = 20) > { > $sql = 'select * from '.$table.' where '.$where; > if ($page !== false) > { > $sql .= ' limit '.(($page-1)*$perpage).', '.

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : > >> I would say your pagination logic belongs in myPDO.class.php. Where I >> have this functionality it's as simple as two arguments to the method >> that gets data, $page and $perpage. Setting both to false would >> retrieve all rows. > > Interesting but, still no clue, on this si

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I would say your pagination logic belongs in myPDO.class.php. Where I > have this functionality it's as simple as two arguments to the method > that gets data, $page and $perpage. Setting both to false would > retrieve all rows. Interesting but, still no clue, on this side, about how to accomp

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : >> I don't know how your other classes are arranged, > > myPDO.class.php -> Singleton. Makes the connection to the database possible. > > generalDAO.class.php -> Abstract DAO Class, grabs the myPDO instance and > could have other methods on the future that are shared for all the DA

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> I don't know how your other classes are arranged, myPDO.class.php -> Singleton. Makes the connection to the database possible. generalDAO.class.php -> Abstract DAO Class, grabs the myPDO instance and could have other methods on the future that are shared for all the DAO classes. AnimalsDAO.c

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : >> Pagination is the generically applicable class - it should know >> nothing about what specifically it's paginating. > > Ok... but I need to grab values of my DAO classes, I mean, even if we > paginate images on a directory or records on a database table, the pagination > should

RE: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
> Pagination is the generically applicable class - it should know > nothing about what specifically it's paginating. Ok... but I need to grab values of my DAO classes, I mean, even if we paginate images on a directory or records on a database table, the pagination should have a $limit, and a off

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
2009/7/19 MEM : > Hello, > > I have a Animals DAO class that I'd like to apply a pagination class to it. > > Between this two classes, there will be a composition relation (more > precisely, an association one). My question is: > > Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pa

[PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread MEM
Hello, I have a Animals DAO class that I'd like to apply a pagination class to it. Between this two classes, there will be a composition relation (more precisely, an association one). My question is: Is a Pagination that "has a" Animal. OR Is a Animal that "has a" pagination? Should we create on