Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 4974 Rev 4985
Línea 309... Línea 309...
309
                $hydrator->hydrate($dataPost, $location);
309
                $hydrator->hydrate($dataPost, $location);
Línea 310... Línea 310...
310
                
310
                
311
                $locationMapper= LocationMapper::getInstance($this->adapter);
311
                $locationMapper= LocationMapper::getInstance($this->adapter);
Línea 312... Línea -...
312
                $resultLocation = $locationMapper->insert($location);
-
 
313
 
312
                $resultLocation = $locationMapper->insert($location);
314
 
313
 
315
                if (!$resultLocation) {
314
                if (!$resultLocation) {
316
                    return new JsonModel([
315
                    return new JsonModel([
317
                        'success'   => false,
316
                        'success'   => false,
Línea 323... Línea 322...
323
                $jobCategory = new SurveyJobCategory();
322
                $jobCategory = new SurveyJobCategory();
324
                $industry = new SurveyIndustry();
323
                $industry = new SurveyIndustry();
325
                $service = new SurveyService();
324
                $service = new SurveyService();
Línea 326... Línea 325...
326
 
325
 
-
 
326
                if($dataPost['job_description_id']){
327
                if($dataPost['job_description_id']){
327
                    foreach($dataPost['job_description_id'] as $jobDescriptionId) {
328
                    $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
328
                        $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
329
                    $JobDescriptionSurveyId = $jobDescriptionMapper->fetchOneByUuid($dataPost['job_description_id']);
329
                        $JobDescriptionSurveyId = $jobDescriptionMapper->fetchOneByUuid($jobDescriptionId);
330
                    $hydrator->hydrate($dataPost, $JobDescriptionSurveyId);
330
                        $hydrator->hydrate($dataPost, $JobDescriptionSurveyId);
331
                    $survey_id = $survey->id;
331
                        $survey_id = $survey->id;
332
                    $surveyJobDescriptionMapper = SurveyJobDescriptionMapper::getInstance($this->adapter);
332
                        $surveyJobDescriptionMapper = SurveyJobDescriptionMapper::getInstance($this->adapter);
333
                    $record = [
333
                        $record = [
334
                        'survey_id' => $survey_id,
334
                            'survey_id' => $survey_id,
335
                        'job_description_id' => $JobDescriptionSurveyId,
-
 
336
                    ];
-
 
337
                    $record = $surveyJobDescriptionMapper->insert($JobDescriptionSurveyId, $survey_id);
-
 
338
 
-
 
339
                    if($record){
-
 
340
                        $data = [
-
 
341
                            'success' => true,
-
 
342
                            'data' => 'LABEL_RECORD_ADDED'
335
                            'job_description_id' => $JobDescriptionSurveyId,
-
 
336
                        ];
-
 
337
                        $record = $surveyJobDescriptionMapper->insert($JobDescriptionSurveyId, $survey_id);
-
 
338
 
-
 
339
                        if($record){
-
 
340
                            $data = [
-
 
341
                                'success' => true,
-
 
342
                                'data' => 'LABEL_RECORD_ADDED'
-
 
343
                            ];
343
                        ];
344
                        }
344
                    }
345
                    }
Línea 345... Línea 346...
345
                }
346
                }
-
 
347
 
346
 
348
                if($dataPost['job_category_id']){
347
                if($dataPost['job_category_id']){
349
                    foreach($dataPost['job_category_id'] as $jobCategoryId) {
348
                    $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
350
                        $jobCategoryMapper = JobCategoryMapper::getInstance($this->adapter);
349
                    $JobCategorySurveyId = $jobCategoryMapper->fetchOneByUuid( $dataPost['job_category_id']);
351
                        $JobCategorySurveyId = $jobCategoryMapper->fetchOneByUuid($jobCategoryId);
350
                    $hydrator->hydrate($dataPost, $JobCategorySurveyId);
352
                        $hydrator->hydrate($dataPost, $JobCategorySurveyId);
351
                    $survey_id = $survey->id;
353
                        $survey_id = $survey->id;
352
                    $surveyJobCategoryMapper = SurveyJobCategoryMapper::getInstance($this->adapter);
354
                        $surveyJobCategoryMapper = SurveyJobCategoryMapper::getInstance($this->adapter);
353
                    $record = [
355
                        $record = [
354
                        'survey_id' => $survey_id,
-
 
355
                        'job_category_id' => $JobCategorySurveyId,
-
 
356
                    ];
-
 
357
                    $record = $surveyJobCategoryMapper->insert($JobCategorySurveyId, $survey_id);
-
 
358
 
-
 
359
                    if($record){
-
 
360
                        $data = [
-
 
361
                            'success' => true,
356
                            'survey_id' => $survey_id,
-
 
357
                            'job_category_id' => $JobCategorySurveyId,
-
 
358
                        ];
-
 
359
                        $record = $surveyJobCategoryMapper->insert($JobCategorySurveyId, $survey_id);
-
 
360
 
-
 
361
                        if($record){
-
 
362
                            $data = [
-
 
363
                                'success' => true,
-
 
364
                                'data' => 'LABEL_RECORD_ADDED'
362
                            'data' => 'LABEL_RECORD_ADDED'
365
                            ];
363
                        ];
366
                        }
Línea 364... Línea 367...
364
                    }
367
                    }
-
 
368
                }
365
                }
369
 
366
 
370
                if($dataPost['industry_id']){
367
                if($dataPost['industry_id']){
371
                    foreach($dataPost['industry_id'] as $industry_id) {
368
                    $industryMapper = IndustryMapper::getInstance($this->adapter);
372
                        $industryMapper = IndustryMapper::getInstance($this->adapter);
369
                    $industrySurveyId = $industryMapper->fetchOneByUuid($dataPost['industry_id']);
373
                        $industrySurveyId = $industryMapper->fetchOneByUuid($industry_id);
370
                    $hydrator->hydrate($dataPost, $industrySurveyId);
374
                        $hydrator->hydrate($dataPost, $industrySurveyId);
371
                    $survey_id = $survey->id;
375
                        $survey_id = $survey->id;
372
                    $surveyIndustryMapper = SurveyIndustryMapper::getInstance($this->adapter);
376
                        $surveyIndustryMapper = SurveyIndustryMapper::getInstance($this->adapter);
373
                    $record = [
-
 
374
                        'survey_id' => $survey_id,
-
 
375
                        'industry_id' => $industrySurveyId,
-
 
376
                    ];
-
 
377
                    $record = $surveyIndustryMapper->insert($record);
-
 
378
 
-
 
379
                    if($record){
-
 
380
                        $data = [
377
                        $record = [
-
 
378
                            'survey_id' => $survey_id,
-
 
379
                            'industry_id' => $industrySurveyId,
-
 
380
                        ];
-
 
381
                        $record = $surveyIndustryMapper->insert($record);
-
 
382
 
-
 
383
                        if($record){
-
 
384
                            $data = [
-
 
385
                                'success' => true,
381
                            'success' => true,
386
                                'data' => 'LABEL_RECORD_ADDED'
382
                            'data' => 'LABEL_RECORD_ADDED'
387
                            ];
Línea 383... Línea 388...
383
                        ];
388
                        }
384
                    }
389
                    }
385
                }
390
                }
386
                
391
                
387
                if($dataPost['service_id']){
392
                if($dataPost['service_id']){
388
                    $serviceSurveyId = $dataPost['service_id'];
393
                    foreach($dataPost['service_id'] as $service_id) {
389
                    $hydrator->hydrate($dataPost, $service);
394
                        $hydrator->hydrate($dataPost, $service_id);
390
                    $survey_id = $survey->id;
395
                        $survey_id = $survey->id;
391
                    $surveyServiceMapper = SurveyServiceMapper::getInstance($this->adapter);
-
 
392
                    $record = [
-
 
393
                        'survey_id' => $survey_id,
-
 
394
                        'service_id' => $serviceSurveyId,
-
 
395
                    ];
-
 
396
                    $record = $surveyServiceMapper->insert($record);
-
 
397
 
-
 
398
                    if($record){
396
                        $surveyServiceMapper = SurveyServiceMapper::getInstance($this->adapter);
-
 
397
                        $record = [
-
 
398
                            'survey_id' => $survey_id,
-
 
399
                            'service_id' => $service_id,
-
 
400
                        ];
-
 
401
                        $record = $surveyServiceMapper->insert($record);
-
 
402
 
-
 
403
                        if($record){
-
 
404
                            $data = [
399
                        $data = [
405
                                'success' => true,
400
                            'success' => true,
406
                                'data' => 'LABEL_RECORD_ADDED'
Línea 401... Línea 407...
401
                            'data' => 'LABEL_RECORD_ADDED'
407
                            ];
402
                        ];
408
                        }