0

I'm currently implementing my DAL using DAO's. I would like to do pagination at the database level, so in my DAO's I currently have methods like

getEvents($page, $limit) 

and

getEventCount()

Then in my service layer I'm returning an array

array($events, $eventCount)

and setting up the pagination in my controller (using Zend_Paginator).

Something doesn't seem right about this approach, but I can't put my finger on it.

blockhead
  • 9,655
  • 3
  • 43
  • 69

1 Answers1

0

i would go with having models that extend an abstract class and that one will implement an access to either Zend_Db_Table or another class that you later might want as your Data provider.

Much more abstractization than this would be an overkill in my oppinion

Gabriel Solomon
  • 29,065
  • 15
  • 57
  • 79
  • Basically what I was going to say. This question is related: http://stackoverflow.com/questions/1063664/zend-framework-orm-style-table-data-gateway-vs-extending-zenddbtableabstract/1068296#1068296 – Kieran Hall Jul 01 '09 at 10:01
  • My models are "POPOs". In other words, they don't extends any other classes (they do implement interfaces sometimes like Zend_Acl_Resource_Interface). But other than that, my models do not how they are getting their data, and how they're being persisted. That's the point of the DAL. – blockhead Jul 01 '09 at 12:30
  • @Kieran.Hall I'm not sure what that answer has to do with my question. – blockhead Jul 01 '09 at 12:32