1

I have a form comment. I want to get the user ID from Zend_Auth to insert into my database. How can I do it?

Eitan T
  • 32,660
  • 14
  • 72
  • 109
Vuong Tran
  • 31
  • 1
  • 5

1 Answers1

3

If Zend_Auth has been instantiated, then:

  1. Get an instance of it:
    $auth = Zend_Auth::getInstance();

  2. Get the identity you must have stored on authentication success:
    $identity = $auth->getIdentity();

  3. Use the identity according to the model of what you stored.

Eitan T
  • 32,660
  • 14
  • 72
  • 109
burntblark
  • 1,680
  • 1
  • 15
  • 25