Subversion Repositories SmartDukaan

Rev

Rev 21208 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21208 Rev 21209
Line 62... Line 62...
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)) {
66
					if(!array_key_exists('notification_type', $dataForModel)) {
67
						$dataForModel['notification_type'] = 'fcm';
67
						$dataForModel['notification_type'] = 'gcm';
68
					} 
68
					} 
69
					$dataForModel['failurecount'] = 0;					
69
					$dataForModel['failurecount'] = 0;					
70
				}else{
70
				}else{
71
					$this->GcmUser->create();
71
					$this->GcmUser->create();
72
				}			
72
				}