views:

303

answers:

1

First post here so sorry if I seem like a newb,

I am trying to find a way to use Zend_Auth_Adapter with a data mapper, but seem to be struggling. I know I can use Zend_Auth_Adapter_DbTable and associate this with a db table, but this seems to negate the whole reason for having a data mapper (I think)?! Should I be creating a custom adapter for the mapper so that I can use the mapper to choose whatever I want as my data source?

+2  A: 

Good question. The proper way to do that would be to roll your own Zend_Auth_Adapter. I have done so for Doctrine (my ORM).

I also use the data mapper pattern throughout my application, but I do not use it for my authentication. It adds a lot of needless overhead imo. I just query the database directly using my Auth_Adapter.

hobodave
Thanks hobodave, that's really useful. I'm going to create a custom Zend_Auth_Adapter as that makes most sense to me.
wiseguydigital