views:

115

answers:

1

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.

A: 

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

solomongaby
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
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
@Kieran.Hall I'm not sure what that answer has to do with my question.
blockhead