« Return to Thread: [need advices] An idea to build a KISS ORM system upon Zend_Db_Table

Re: [need advices] An idea to build a KISS ORM system upon Zend_Db_Table

by Victor Bolshov :: Rate this Message:

Reply to Author | View in Thread

Peter Hodge wrote:

> I had a few special requirements for *my ORM*, which ZF ORM would need to cater
> for:
>
> - I need to configure the ORM classes to automatically add 'WHERE dogs.Archived
> = 0' when doing a '$dogs->fetchAll()'
>
> - If the current user has access only to certain breeds of dogs, the ORM
> classes need to automatically add 'JOIN dogs_breeds ... WHERE dogs_breeds
> IN({$user->allowedBreeds()})' when doing a '$dogs->fetchAll()'.
>
> This allowed me to deal with 'hidden' records and a detailed security model
> without re-specifying the rules everywhere in my application - it saved my alot
> of time and testing.
>
> cheers,
> Peter
It seems to me that this would really be *your ORM* ;)
Personally, I don't see how your requirements conform with a KISS
principle. However, possibly you could achieve your goals by extending
overriding Zend_Db_Table's methods in your own *_Table classes.

Regards,

Victor


smime.p7s (4K) Download Attachment

 « Return to Thread: [need advices] An idea to build a KISS ORM system upon Zend_Db_Table