2011-02-16 57 views

回答

2

我剛剛注意到這實際上是屬於關係。所以代碼應該如下...

protected $_belongs_to = array(
    'user_from' => array('model' => 'user', 'foreign_key' => 'user_id_from'), 
    'user_to' => array('model' => 'user', 'foreign_key' => 'user_id_to') 
); 

user_from和user_to可以改變,但是你想要訪問它們。

$message->user_from 

$message->user_to 
相關問題