Currently I have this code (Fetching user informations from Database then store into Zend_Auth session storage)
$auth = Zend_Auth::getInstance();
$storage = $auth->getStorage();
$storage->write($authAdapter->getResultRowObject(array('email', 'firstName', 'lastName', 'provide开发者_运维百科rId'))); // store into session
But now I wanted to store a role variable in the storage as well (the problem is that my user table doesn't have a role column therefore I wanted to add a role variable to the storage). So how can I add an extra role variable to the storage? is it possible?
Thanks so much !
I think i worked out here is my solution
$storage = $auth->getStorage();
$userInfo = $authAdapter->getResultRowObject(array('email', 'firstName', 'lastName','providerId'));
$role = new stdClass;
$userInfo->role = 'Provider';
$storage->write($userInfo); // store into session
But unsure if I use stdClass is a good idea? any suggestion?
精彩评论