protected $_name = 'usertable';  //table name for database [Impt] Please change accordingly
protected $_temp;       
function resetPass($userid)
{
    $pass = new Application_Model_Register();
    $salt = $pass->generateSalt();
    $temp = $pass->generatePass();
    $this->_temp = (string) $temp;
    $data = array(
            'password' => hash("sha256", ($salt. $temp)),
            'salt' => $salt, //get salt from generateSalt()
    );
    //$auth= Zend_Auth::getInstance(); //declare zend_auth to get instance
    //$user= $auth->getIdentity(); //get identity of user
    //$userid   = $user->userid; //get userid of user
    echo $temp;
    $this->update($data, 'userid = '. (int)($userid));
    return $this;
}
function getTemp()
{
    return parent::$this->_temp;
}
これはモデルの私のコードです。$_temp を返そうとしているので、$this->temp = $temp にしました。私の問題は、NULL を返すことです。
public function sendEmail($email)
{
    $email = $_POST['email'];
    $userid = '30';
    $reset = new Application_Model_DbTable_Register();
    $reset->resetPass($userid);
    $pswd = new Application_Model_DbTable_Register();
    $pswd = $pswd->getTemp();
    var_dump($pswd);
    $mail = new Zend_Mail();
    $mail->setFrom('swap.test@yahoo.com.sg', 'Inexorable Beauty');
    $mail->addTo($email, $email);
    $mail->setSubject('Inexorable Beauty: Password Reset');
    $mail->setBodyText('Dear Customer,
            You have requested to reset your password.
            This is the temporary password: '.$pswd.'
            Please log in immediately and change your password.
            Thank You.
            Yours Sincerely,
            Inexorable Beauty');
    $mail->send();
    if($mail->send())
    {
        echo "Email successfully sent!";
    }
    else
    {
        echo "Email was not sent";
    }
}
これは私のコントローラーコードです。一時的なパスワードを顧客の電子メールに送信しようとしています。モデルから getTemp() 関数を呼び出して passwd 文字列を取得しましたが、ご覧のとおり、var_dump($pswd) を実行すると NULL が返され続けます。解決策はありますか?