Hi there,
While working on the login part of an application, I find myself running into an issue:
My model is based on Active Record, by extending Zend_Db_Table_Row objects. Whenever I have to deal with a user, I'd want to do this through the User object (being an extended table row). However, Zend_Auth_Adapter_DbTable::getResultRowObject() returns a stdClass and I can not find a way to tell Zend_Auth_Adapter_DbTable to use a specific Db_Table.
My three options that I've found so far:
Write a custom Zend_Auth_Adapter, to return the proper class object (using Zend_Db_Table internally).
After authentication perform some reading of the stdClass and some writing of the User object - can you create a Zend_Db_Table_Row class without actually using the Zend_Db_Table to create it?
Move away from Active Record into complete Domain Driven development, separating my data access away from the user object. Then write a second mapper to fill the User object with stdClass instead of the table row.
My two questions: Which of these would you recommend? And is there something I am missing?
I'd hate to do any of these and then find out I'm missing something obvious in the Framework. Does anyone know if there is a 'proper' way to be doing this?
Regards, Sander