Back to User class

Method __wakeup

public void
__wakeup
()
Method to recover the full object on unserialize.
Returns
  • void
Since
  • 3.6.0
Class: User
Project: Joomla

Method __wakeup - Source code

/**
 * Method to recover the full object on unserialize.
 *
 * @return  void
 *
 * @since   3.6.0
 */
public function __wakeup()
{
    // Initialise some variables
    $this->_params = new Registry();
    // Load the user if it exists
    if (!empty($this->id) && $this->load($this->id)) {
        // Push user into cached instances.
        self::$instances[$this->id] = $this;
    } else {
        // Initialise
        $this->id = 0;
        $this->sendEmail = 0;
        $this->aid = 0;
        $this->guest = 1;
    }
}