| Line 61... |
Line 61... |
| 61 |
$this->log('before find '.print_r($dataForModel,1),'gcm');
|
61 |
$this->log('before find '.print_r($dataForModel,1),'gcm');
|
| 62 |
$data = $this->GcmUser->find('first',array('conditions'=>array('user_id'=>$this->request->data['user_id'],'imeinumber'=>$this->request->data['imeinumber']),'order'=>array('id'=>'desc')));
|
62 |
$data = $this->GcmUser->find('first',array('conditions'=>array('user_id'=>$this->request->data['user_id'],'imeinumber'=>$this->request->data['imeinumber']),'order'=>array('id'=>'desc')));
|
| 63 |
$this->log("found row ".print_r($data,1),'gcm');
|
63 |
$this->log("found row ".print_r($data,1),'gcm');
|
| 64 |
if(!empty($data)){
|
64 |
if(!empty($data)){
|
| 65 |
$dataForModel['id'] = $data['GcmUser']['id'];
|
65 |
$dataForModel['id'] = $data['GcmUser']['id'];
|
| - |
|
66 |
if(!array_key_exists('notification_type', $dataForModel)) {
|
| - |
|
67 |
$dataForModel['notification_type'] = 'fcm';
|
| - |
|
68 |
}
|
| 66 |
$dataForModel['failurecount'] = 0;
|
69 |
$dataForModel['failurecount'] = 0;
|
| 67 |
}else{
|
70 |
}else{
|
| 68 |
$this->GcmUser->create();
|
71 |
$this->GcmUser->create();
|
| 69 |
}
|
72 |
}
|
| 70 |
$this->log('lets save '.print_r($dataForModel,1),'gcm');
|
73 |
$this->log('lets save '.print_r($dataForModel,1),'gcm');
|