Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 411 Rev 3186
Línea 194... Línea 194...
194
        {
194
        {
195
            error_log($update->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
195
            error_log($update->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
196
            $this->processError($e);
196
            $this->processError($e);
197
        }
197
        }
Línea -... Línea 198...
-
 
198
        
198
        
199
        
199
        return false;
200
        return false;
Línea 200... Línea 201...
200
    }
201
    }
201
    
202
    
Línea 220... Línea 221...
220
        {
221
        {
221
            error_log($delete->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
222
            error_log($delete->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
222
            $this->processError($e);
223
            $this->processError($e);
223
        }
224
        }
Línea -... Línea 225...
-
 
225
        
224
        
226
        
225
        return false;
227
        return false;
Línea 226... Línea 228...
226
    }
228
    }
227
    
229
    
Línea 252... Línea 254...
252
                }
254
                }
Línea 253... Línea 255...
253
                
255
                
254
                return $records;
256
                return $records;
255
            }
257
            }
256
        }
258
        }
-
 
259
        catch(\Exception $e) 
257
        catch(\Exception $e) {
260
        { 
258
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
261
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
259
            $this->processError($e);
262
            $this->processError($e);
Línea 260... Línea 263...
260
        }
263
        }
Línea 284... Línea 287...
284
                    array_push($records, $record);
287
                    array_push($records, $record);
285
                }
288
                }
286
                return $records;
289
                return $records;
287
            }
290
            }
288
        }
291
        }
289
        catch(\Exception $e) {
292
        catch(\Exception $e)
-
 
293
        {
290
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
294
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
291
            $this->processError($e);
295
            $this->processError($e);
292
        }
296
        }
-
 
297
 
-
 
298
        
293
        return [];
299
        return [];
294
    }
300
    }
Línea 295... Línea 301...
295
    
301
    
296
    /**
302
    /**
Línea 315... Línea 321...
315
                $hydrator->hydrate($result->current(), $prototype);
321
                $hydrator->hydrate($result->current(), $prototype);
Línea 316... Línea 322...
316
                
322
                
317
                return $prototype;
323
                return $prototype;
318
            }
324
            }
319
        }
325
        }
-
 
326
        catch(\Exception $e) 
320
        catch(\Exception $e) {
327
        {
321
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
328
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
322
            $this->processError($e);
329
            $this->processError($e);
-
 
330
        }
Línea 323... Línea 331...
323
        }
331
 
324
        
332
        
Línea 325... Línea 333...
325
        return;
333
        return;
Línea 343... Línea 351...
343
            if ($result instanceof ResultInterface && $result->isQueryResult() && $result->count()) {
351
            if ($result instanceof ResultInterface && $result->isQueryResult() && $result->count()) {
Línea 344... Línea 352...
344
                
352
                
345
                return $result->current();
353
                return $result->current();
346
            }
354
            }
347
        }
355
        }
-
 
356
        catch(\Exception $e) 
348
        catch(\Exception $e) {
357
        {
349
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
358
            error_log($select->getSqlString($this->adapter->platform) . ' ' .  $e->getMessage());
350
            $this->processError($e);
359
            $this->processError($e);
-
 
360
        }
Línea 351... Línea 361...
351
        }
361
 
352
        
362
        
Línea 353... Línea 363...
353
        return;
363
        return;
Línea 373... Línea 383...
373
                $this->lastInsertId = $result->getGeneratedValue();
383
                $this->lastInsertId = $result->getGeneratedValue();
374
                $this->affectedRows = $result->getAffectedRows();
384
                $this->affectedRows = $result->getAffectedRows();
375
                return true;
385
                return true;
376
            }
386
            }
377
        }
387
        }
378
        catch(\Exception $e) {
388
        catch(\Exception $e)
-
 
389
        {
379
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
390
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
380
            $this->processError($e);
391
            $this->processError($e);
381
        }
392
        }
382
        
393
 
383
        return false;
394
        return false;
384
    }
395
    }
Línea 385... Línea 396...
385
    
396
    
Línea 404... Línea 415...
404
            if($result) {
415
            if($result) {
405
                $this->affectedRows = $result->getAffectedRows();
416
                $this->affectedRows = $result->getAffectedRows();
406
                return true;
417
                return true;
407
            }
418
            }
408
        }
419
        }
409
        catch(\Exception $e) {
420
        catch(\Exception $e)
-
 
421
        {
-
 
422
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
410
            $this->processError($e);
423
            $this->processError($e);
411
        }
424
        }
Línea 412... Línea 425...
412
        
425
        
413
        return false;
426
        return false;
Línea 445... Línea 458...
445
                    
458
                    
446
                    return $records;
459
                    return $records;
447
                }
460
                }
448
            }
461
            }
449
        }
462
        }
-
 
463
        catch(\Exception $e) 
450
        catch(\Exception $e) {
464
        {
451
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
465
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
452
            $this->processError($e);
466
            $this->processError($e);
-
 
467
        }
Línea 453... Línea 468...
453
        }
468
 
454
        
469
        
Línea 455... Línea 470...
455
        return [];
470
        return [];
Línea 479... Línea 494...
479
                }
494
                }
Línea 480... Línea 495...
480
                
495
                
481
                return $records;;
496
                return $records;;
482
            }
497
            }
483
        }
498
        }
-
 
499
        catch(\Exception $e)
484
        catch(\Exception $e) {
500
        {
485
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
501
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
486
            $this->processError($e);
502
            $this->processError($e);
-
 
503
        }
-
 
504
 
487
        }
505
        
488
        return [];
506
        return [];
Línea 489... Línea 507...
489
    }
507
    }
490
    
508
    
Línea 510... Línea 528...
510
                $hydrator->hydrate($result->current(), $prototype);
528
                $hydrator->hydrate($result->current(), $prototype);
Línea 511... Línea 529...
511
                
529
                
512
                return $prototype;
530
                return $prototype;
513
            }
531
            }
514
        }
532
        }
-
 
533
        catch(\Exception $e)
515
        catch(\Exception $e) {
534
        {
516
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
535
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
517
            $this->processError($e);
536
            $this->processError($e);
-
 
537
        }
Línea 518... Línea 538...
518
        }
538
 
519
        
539
        
Línea 520... Línea 540...
520
        return;
540
        return;
Línea 538... Línea 558...
538
            if ($result instanceof ResultInterface && $result->isQueryResult() && $result->count()) {
558
            if ($result instanceof ResultInterface && $result->isQueryResult() && $result->count()) {
Línea 539... Línea 559...
539
                
559
                
540
                return $result->current();
560
                return $result->current();
541
            }
561
            }
542
        }
562
        }
-
 
563
        catch(\Exception $e)
543
        catch(\Exception $e) {
564
        {
544
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
565
            error_log($sql  .  ' (' . implode(',', $parameters) .  ') ' .  $e->getMessage());
545
            $this->processError($e);
566
            $this->processError($e);
-
 
567
        }
Línea 546... Línea 568...
546
        }
568
 
547
        
569
        
Línea 548... Línea 570...
548
        return;
570
        return;
549
    }
571
    }
Línea 550... Línea -...
550
    
-
 
551
    private function processError($e)
572
    
-
 
573
    private function processError($e)
552
    {
574
    {
553
        
-
 
554
        
-
 
555
        $this->errno = $e->getCode();
575
        
556
        
576
        $message = $e->getMessage();
-
 
577
        if (strpos($message, strval(self::SQL_DUPLICATE_RECORD) ) !== false) {
557
        switch($this->errno) 
578
            
-
 
579
            $this->errno = self::SQL_DUPLICATE_RECORD;
558
        {
580
            $this->error = 'ERROR_SQL_DUPLICATE_RECORD';
559
            case self::SQL_DUPLICATE_RECORD :
581
            
560
                $this->error = 'ERROR_SQL_DUPLICATE_RECORD';
582
        } 
-
 
583
        else if (strpos($message, strval(self::SQL_CANNOT_ADD_OR_UPDATE_A_CHILD)  ) !== false) {
561
                break;
584
            
-
 
585
            $this->errno = self::SQL_CANNOT_ADD_OR_UPDATE_A_CHILD ;
562
                
586
            $this->error = 'ERROR_SQL_CANNOT_ADD_OR_UPDATE_A_CHILD';
563
            case self::SQL_CANNOT_ADD_OR_UPDATE_A_CHILD :
587
            
564
                $this->error = 'ERROR_SQL_CANNOT_ADD_OR_UPDATE_A_CHILD';
588
        } 
-
 
589
        else if (strpos($message, strval(self::SQL_CANNOT_DELETE_OR_UPDATE_A_PARENT_ROW) ) !== false) {
565
                break;
590
            
566
                
591
            $this->errno = self::SQL_CANNOT_DELETE_OR_UPDATE_A_PARENT_ROW;
567
            case self::SQL_CANNOT_DELETE_OR_UPDATE_A_PARENT_ROW  : 
592
            $this->error = 'ERROR_SQL_CANNOT_DELETE_OR_UPDATE_A_PARENT_ROW';
568
                $this->error = 'ERROR_SQL_CANNOT_DELETE_OR_UPDATE_A_PARENT_ROW';
593
            
569
                break;
-
 
-
 
594
        } else {
570
                
595
            
-
 
596
            $this->errno = 0;
571
            default : 
597
            $this->error = 'ERROR_THERE_WAS_AN_ERROR';
Línea 572... Línea 598...
572
                $this->error = 'ERROR_THERE_WAS_AN_ERROR';
598
            
573
                break;
599
        }