当用户获得身份验证密钥时,我试图更新一行,但是当我将 $data 数组保存到他们时,我的 $model->attributes 仍然为空。这是我所拥有的:
public function redeemKey($key,$subscription_id){
$key = $this->findbyAttributes(array('key'=>$key));
if(count($key) === 1){
if(is_null($key['date_used'])){
$model = new NewsItemPass;
$model->attributes = $key;
echo "<pre>",print_r($model->attributes),"</pre>";
}
}
}
打印到
Array
(
[id] =>
[key] =>
[date_created] =>
[date_used] =>
[date_expired] =>
[news_subscription_id] =>
[duration] =>
)
我在看什么?