Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6351 Rev 6376
Línea 34... Línea 34...
34
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
34
use LeadersLinked\Hydrator\ObjectPropertyHydrator;
35
use LeadersLinked\Model\SurveyJobDescription;
35
use LeadersLinked\Model\SurveyJobDescription;
36
use LeadersLinked\Model\SurveySkill;
36
use LeadersLinked\Model\SurveySkill;
37
use LeadersLinked\Model\SurveyIndustry;
37
use LeadersLinked\Model\SurveyIndustry;
38
use LeadersLinked\Model\SurveyLanguage;
38
use LeadersLinked\Model\SurveyLanguage;
-
 
39
use LeadersLinked\Model\SurveyLocation;
Línea 39... Línea 40...
39
 
40
 
Línea 40... Línea 41...
40
class SurveyController extends AbstractActionController {
41
class SurveyController extends AbstractActionController {
41
 
42
 
Línea 203... Línea 204...
203
 
204
 
204
            if ($form->isValid()) {
205
            if ($form->isValid()) {
Línea 205... Línea 206...
205
                $dataPost = (array) $form->getData();
206
                $dataPost = (array) $form->getData();
-
 
207
 
-
 
208
                $hydrator = new ObjectPropertyHydrator();
-
 
209
 
-
 
210
                $location = new Location();
-
 
211
                $hydrator->hydrate($dataPost, $location);
-
 
212
                
-
 
213
                $locationMapper= LocationMapper::getInstance($this->adapter);
-
 
214
                $resultLocation = $locationMapper->insert($location);
-
 
215
 
-
 
216
                if (!$resultLocation) {
-
 
217
                    return new JsonModel([
-
 
218
                        'success'   => false,
-
 
219
                        'data' => 'ERROR_THERE_WAS_AN_ERROR'                       
-
 
220
                    ]);
206
 
221
                }
207
                $hydrator = new ObjectPropertyHydrator();
222
 
Línea 208... Línea 223...
208
                $survey = new Survey();
223
                $survey = new Survey();
209
                $hydrator->hydrate($dataPost, $survey);
224
                $hydrator->hydrate($dataPost, $survey);
Línea 225... Línea 240...
225
 
240
 
226
                    $jobDescription = new SurveyJobDescription();
241
                    $jobDescription = new SurveyJobDescription();
227
                    $skill = new SurveySkill();
242
                    $skill = new SurveySkill();
228
                    $industry = new SurveyIndustry();
243
                    $industry = new SurveyIndustry();
-
 
244
                    $language = new SurveyLanguage();
-
 
245
                    $location = new SurveyLocation();
-
 
246
 
-
 
247
                    if(!empty($resultLocation)){ 
-
 
248
 
-
 
249
                        $surveyLocationMapper = SurveyLocationMapper::getInstance($this->adapter);
-
 
250
    
-
 
251
                        $ok = true;
-
 
252
    
-
 
253
                        $record = new SurveyLocation();
-
 
254
                        $record->country = $location->country;
-
 
255
                        $record->city1 = $location->city1;
-
 
256
                        $record->state = $location->state;                       
-
 
257
                        $record->postal_code = $location->postal_code;                   
-
 
258
                        $record->latitude = $location->latitude;                   
-
 
259
                        $record->longitude = $location->longitude;          
-
 
260
                        $record->survey_id = $survey->id;
-
 
261
                        $result = $surveyLanguageMapper->insert($record);
-
 
262
                        $ok = $ok && $result;
-
 
263
                           //}
-
 
264
                          if($ok){
-
 
265
    
-
 
266
                        }
Línea 229... Línea 267...
229
                    $language = new SurveyLanguage();
267
                    }
Línea 230... Línea 268...
230
 
268