2010年8月12日星期四

[fw-auth] Re: Anything that might change my identity stored in Zend_Auth/Session?

turns out, probably, its not a session problem, but something to do with Zend_Auth and Logging in. with a unauthenticated user, the insert proceeds fine

$em = Zend_Registry::get('em'); $config = new DoctrineExtensions\NestedSet\Config($em, 'Application\Models\Post'); $manager = new DoctrineExtensions\NestedSet\Manager($config);  $user = $em->find('Application\Models\User', 2); $post = new Application\Models\Post; $post->title = 'title 2'; $post->body = 'hello world'; $post->user = $user; $manager->createRoot($post); $em->flush(); die;

when i try doing the same operation, from the same place, index action of index controller, it fails.

A new entity was found through a relationship that was not configured to cascade persist operations: Application\Models\User@000000000aea1b5f0000000028c32e2c. Explicitly persist the new entity or configure cascading persist operations on the relationship.

when i change my AuthAdapter to not return a user object in id, i got a different error

return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, 'success login'); // return a string in id instead of the logged in user
A new entity was found through a relationship that was not configured to cascade persist operations: @. Explicitly persist the new entity or configure cascading persist operations on the relationship.

whats with the @



View this message in context: Re: Anything that might change my identity stored in Zend_Auth/Session?
Sent from the Zend Auth mailing list archive at Nabble.com.

没有评论: