2012-02-15 86 views
0

對於我的生活,我無法弄清楚發生了什麼問題。當我調試$order->save操作的值時,我得到一個1(我假定它的意思是true)。下面是我在做什麼:cakephp不保存數據

$order = $this->Order->find('first', array(
    'conditions' => array('Order.token' => urldecode($token)) 
)); 

debug($order); 

$this->Order->id = $order['Order']['id']; 
$orderData = array('Order' => array(
    'id' => $order['Order']['id'], 
    'billing_email' => urldecode($payPalResponse['EMAIL']), 
    'billing_name' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTONAME']), 
    'billing_address' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTOSTREET']), 
    'billing_city' => urldecode($payPalResponse['PAYMENTREQUEST_0_SHIPTOCITY']), 
    'billing_state' => $payPalResponse['PAYMENTREQUEST_0_SHIPTOSTATE'], 
    'billing_zipcode' => $payPalResponse['PAYMENTREQUEST_0_SHIPTOZIP'] 
)); 
debug($orderData); 
$this->Order->save($orderData); 

這裏就是我得到:

controllers/markets_controller.php (line 149) 
Array 
(
    [Order] => Array 
     (
      [id] => 13 
      [token] => ************** 
      [player_id] => 1 
      [status_id] => 1 
      [timestamp] => 2012-02-15 12:09:24 
      [date_filled] => February 15, 2012 
     ) 

    [OrderItem] => Array 
     (
     ) 

) 

controllers/markets_controller.php (line 161) 
Array 
(
    [Order] => Array 
     (
      [id] => 13 
      [billing_email] => *********@************.com 
      [billing_name] => Test User 
      [billing_address] => 1 Main St 
      [billing_city] => San Jose 
      [billing_state] => CA 
      [billing_zipcode] => 95131 
     ) 

) 

爲什麼告訴我,這是節能,但它不是?

回答

0

好吧,我曾嘗試清除緩存之前,但由於某種原因它並沒有採取。我終於清除了Order模型的緩存文件,並修復了它。