2008年10月17日星期五

Re: [fw-auth] Zend_Auth and Join

I believe Zend_Auth is only concerned with authenticating a user, which is usually a simple query, but fortunately you can store any type of object you want into _Auth's storage.

What I do in my auth controller is use _Auth to authenticate, and if valid I load up a custom member object and write that into the storage instead of the result row.

<?php

$user = Member::load($id);
$auth->getStorage()->write($user);

$auth->hasIdentity(); // returns true
$auth->getIdentity(); // returns custom $user object


On Fri, Oct 17, 2008 at 10:09 AM, SiCo007 <simon@sico.co.uk> wrote:

Is there an easy way to get Zend_Auth to do a  join on multiple database
tables using the db table adapter, I assume not as it's not documented.
Basically I need a users role which is stored in a different table.

Should I simply do two queries and compile my own user model or extend the
adapter and carry out my own query?

-----
Simon

http://www.ajb007.co.uk/
--
View this message in context: http://www.nabble.com/Zend_Auth-and-Join-tp20037382p20037382.html
Sent from the Zend Auth mailing list archive at Nabble.com.




--
-Hector

没有评论: