function update() { $user = new Users(); $user->select(array('id' => $this->id)); // Because passwords are stored hashed, we don't want to hash a hash if ($user->password !== $this->password) { $this->password = Auth::get_instance()->create_hashed_password($this->password); } parent::update(); }