Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1134 | Rev 1224 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1134 Rev 1138
Línea 157... Línea 157...
157
                $behaviorMapper = BehaviorsMapper::getInstance($this->adapter);
157
                $behaviorMapper = BehaviorsMapper::getInstance($this->adapter);
Línea 158... Línea 158...
158
 
158
 
Línea 159... Línea 159...
159
                $recordExists = $behaviorMapper->fetchOneByDescription($dataPost['description'], $currentCompany ? $currentCompany->id : null);
159
                $recordExists = $behaviorMapper->fetchOneByDescription($dataPost['description'], $currentCompany ? $currentCompany->id : null);
160
 
160
 
161
                if ($recordExists) {
161
                if ($recordExists) {
162
                    
162
 
163
                    $data = [
163
                    $data = [
164
                        'success' => false,
164
                        'success' => false,
165
                        'message' => 'El registro ya existe'
-
 
166
                    ];
165
                        'message' => 'El registro ya existe'
Línea 167... Línea 166...
167
                    
166
                    ];
Línea 168... Línea 167...
168
                } else {
167
                } else {
169
 
168
 
170
                    $result = $behaviorMapper->insert($behavior);
169
                    $result = $behaviorMapper->insert($behavior);
Línea 171... Línea 170...
171
 
170
 
172
                    if ($result) {
171
                    if ($result) {
173
                        
172
 
174
                        $this->logger->info('Se agrego la conducta observable ' . $behavior->description, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
173
                        $this->logger->info('Se agrego la conducta observable ' . $behavior->description, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
175
 
174
 
176
                        $recordExists = $behaviorMapper->fetchOneByDescription($dataPost['description'], $currentCompany ? $currentCompany->id : null);
175
                        $recordExists = $behaviorMapper->fetchOneByDescription($dataPost['description'], $currentCompany ? $currentCompany->id : null);
177
                       
176
 
178
                        if ($recordExists) {
177
                        if ($recordExists) {
179
                            $data = [
-
 
180
                                'success' => true,
178
                            $data = [
181
                                'uuid' => $recordExists->uuid
179
                                'success' => true,
182
                            ];
180
                                'uuid' => $recordExists->uuid
183
                        }
181
                            ];
184
                        
182
                        }