2010-12-22 23 views
1

使用createRow我有被延長Zend_Db_Table_Row一個Model_User類,但是當我嘗試插入一行是這樣的:不能從一個Zend_Db_Table_Row

$user = new Model_User(); 

    $data = array(
     'user_login' => $form->getValue('username'), 
     'user_password' => $this->saltPassword($form->getValue('password')), 
     'user_email' => $form->getValue('email') 
    ); 

    $newUser = $user->createRow($data); 

我得到一個錯誤:An error occurred, Application error (其實沒有人知道如何有更清晰的錯誤信息?這些都是非常模糊)

我的模型類就像在this post的解決方案描述。 (所以我也有被延長Zend_Db_Table_Abstract一個Model_User_Table類)

任何想法?

+1

要獲取更清晰的錯誤消息,請將Zend放入開發模式。默認的生產行爲是爲了使攻擊者難以使用有關您的應用程序爲了攻擊您而生成的失敗的信息,以使沉默錯誤消息無效。 – 2010-12-22 15:47:42

+0

我怎樣才能切換到開發模式?我在我的application.ini中有幾個'類別'感謝您的幫助! – networkprofile 2010-12-22 15:52:47

回答

1

方法createRow定義爲Zend_Db_Table_Abstract,而不是Zend_Db_Table_Row_Abstract。只需將您的代碼更改爲

$user = new Model_User_Table(); 
$newUser = $user->createRow($data);