Code Duplication    Length = 22-22 lines in 12 locations

src/eXpansion/Bundle/LocalRecords/Model/Base/RecordQuery.php 8 locations

@@ 311-332 (lines=22) @@
308
     *
309
     * @return $this|ChildRecordQuery The current query, for fluid interface
310
     */
311
    public function filterById($id = null, $comparison = null)
312
    {
313
        if (is_array($id)) {
314
            $useMinMax = false;
315
            if (isset($id['min'])) {
316
                $this->addUsingAlias(RecordTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);
317
                $useMinMax = true;
318
            }
319
            if (isset($id['max'])) {
320
                $this->addUsingAlias(RecordTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);
321
                $useMinMax = true;
322
            }
323
            if ($useMinMax) {
324
                return $this;
325
            }
326
            if (null === $comparison) {
327
                $comparison = Criteria::IN;
328
            }
329
        }
330
331
        return $this->addUsingAlias(RecordTableMap::COL_ID, $id, $comparison);
332
    }
333
334
    /**
335
     * Filter the query on the mapUid column
@@ 377-398 (lines=22) @@
374
     *
375
     * @return $this|ChildRecordQuery The current query, for fluid interface
376
     */
377
    public function filterByNblaps($nblaps = null, $comparison = null)
378
    {
379
        if (is_array($nblaps)) {
380
            $useMinMax = false;
381
            if (isset($nblaps['min'])) {
382
                $this->addUsingAlias(RecordTableMap::COL_NBLAPS, $nblaps['min'], Criteria::GREATER_EQUAL);
383
                $useMinMax = true;
384
            }
385
            if (isset($nblaps['max'])) {
386
                $this->addUsingAlias(RecordTableMap::COL_NBLAPS, $nblaps['max'], Criteria::LESS_EQUAL);
387
                $useMinMax = true;
388
            }
389
            if ($useMinMax) {
390
                return $this;
391
            }
392
            if (null === $comparison) {
393
                $comparison = Criteria::IN;
394
            }
395
        }
396
397
        return $this->addUsingAlias(RecordTableMap::COL_NBLAPS, $nblaps, $comparison);
398
    }
399
400
    /**
401
     * Filter the query on the score column
@@ 418-439 (lines=22) @@
415
     *
416
     * @return $this|ChildRecordQuery The current query, for fluid interface
417
     */
418
    public function filterByScore($score = null, $comparison = null)
419
    {
420
        if (is_array($score)) {
421
            $useMinMax = false;
422
            if (isset($score['min'])) {
423
                $this->addUsingAlias(RecordTableMap::COL_SCORE, $score['min'], Criteria::GREATER_EQUAL);
424
                $useMinMax = true;
425
            }
426
            if (isset($score['max'])) {
427
                $this->addUsingAlias(RecordTableMap::COL_SCORE, $score['max'], Criteria::LESS_EQUAL);
428
                $useMinMax = true;
429
            }
430
            if ($useMinMax) {
431
                return $this;
432
            }
433
            if (null === $comparison) {
434
                $comparison = Criteria::IN;
435
            }
436
        }
437
438
        return $this->addUsingAlias(RecordTableMap::COL_SCORE, $score, $comparison);
439
    }
440
441
    /**
442
     * Filter the query on the nbFinish column
@@ 459-480 (lines=22) @@
456
     *
457
     * @return $this|ChildRecordQuery The current query, for fluid interface
458
     */
459
    public function filterByNbfinish($nbfinish = null, $comparison = null)
460
    {
461
        if (is_array($nbfinish)) {
462
            $useMinMax = false;
463
            if (isset($nbfinish['min'])) {
464
                $this->addUsingAlias(RecordTableMap::COL_NBFINISH, $nbfinish['min'], Criteria::GREATER_EQUAL);
465
                $useMinMax = true;
466
            }
467
            if (isset($nbfinish['max'])) {
468
                $this->addUsingAlias(RecordTableMap::COL_NBFINISH, $nbfinish['max'], Criteria::LESS_EQUAL);
469
                $useMinMax = true;
470
            }
471
            if ($useMinMax) {
472
                return $this;
473
            }
474
            if (null === $comparison) {
475
                $comparison = Criteria::IN;
476
            }
477
        }
478
479
        return $this->addUsingAlias(RecordTableMap::COL_NBFINISH, $nbfinish, $comparison);
480
    }
481
482
    /**
483
     * Filter the query on the avgScore column
@@ 500-521 (lines=22) @@
497
     *
498
     * @return $this|ChildRecordQuery The current query, for fluid interface
499
     */
500
    public function filterByAvgscore($avgscore = null, $comparison = null)
501
    {
502
        if (is_array($avgscore)) {
503
            $useMinMax = false;
504
            if (isset($avgscore['min'])) {
505
                $this->addUsingAlias(RecordTableMap::COL_AVGSCORE, $avgscore['min'], Criteria::GREATER_EQUAL);
506
                $useMinMax = true;
507
            }
508
            if (isset($avgscore['max'])) {
509
                $this->addUsingAlias(RecordTableMap::COL_AVGSCORE, $avgscore['max'], Criteria::LESS_EQUAL);
510
                $useMinMax = true;
511
            }
512
            if ($useMinMax) {
513
                return $this;
514
            }
515
            if (null === $comparison) {
516
                $comparison = Criteria::IN;
517
            }
518
        }
519
520
        return $this->addUsingAlias(RecordTableMap::COL_AVGSCORE, $avgscore, $comparison);
521
    }
522
523
    /**
524
     * Filter the query on the checkpoints column
@@ 568-589 (lines=22) @@
565
     *
566
     * @return $this|ChildRecordQuery The current query, for fluid interface
567
     */
568
    public function filterByPlayerId($playerId = null, $comparison = null)
569
    {
570
        if (is_array($playerId)) {
571
            $useMinMax = false;
572
            if (isset($playerId['min'])) {
573
                $this->addUsingAlias(RecordTableMap::COL_PLAYER_ID, $playerId['min'], Criteria::GREATER_EQUAL);
574
                $useMinMax = true;
575
            }
576
            if (isset($playerId['max'])) {
577
                $this->addUsingAlias(RecordTableMap::COL_PLAYER_ID, $playerId['max'], Criteria::LESS_EQUAL);
578
                $useMinMax = true;
579
            }
580
            if ($useMinMax) {
581
                return $this;
582
            }
583
            if (null === $comparison) {
584
                $comparison = Criteria::IN;
585
            }
586
        }
587
588
        return $this->addUsingAlias(RecordTableMap::COL_PLAYER_ID, $playerId, $comparison);
589
    }
590
591
    /**
592
     * Filter the query on the created_at column
@@ 611-632 (lines=22) @@
608
     *
609
     * @return $this|ChildRecordQuery The current query, for fluid interface
610
     */
611
    public function filterByCreatedAt($createdAt = null, $comparison = null)
612
    {
613
        if (is_array($createdAt)) {
614
            $useMinMax = false;
615
            if (isset($createdAt['min'])) {
616
                $this->addUsingAlias(RecordTableMap::COL_CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
617
                $useMinMax = true;
618
            }
619
            if (isset($createdAt['max'])) {
620
                $this->addUsingAlias(RecordTableMap::COL_CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
621
                $useMinMax = true;
622
            }
623
            if ($useMinMax) {
624
                return $this;
625
            }
626
            if (null === $comparison) {
627
                $comparison = Criteria::IN;
628
            }
629
        }
630
631
        return $this->addUsingAlias(RecordTableMap::COL_CREATED_AT, $createdAt, $comparison);
632
    }
633
634
    /**
635
     * Filter the query on the updated_at column
@@ 654-675 (lines=22) @@
651
     *
652
     * @return $this|ChildRecordQuery The current query, for fluid interface
653
     */
654
    public function filterByUpdatedAt($updatedAt = null, $comparison = null)
655
    {
656
        if (is_array($updatedAt)) {
657
            $useMinMax = false;
658
            if (isset($updatedAt['min'])) {
659
                $this->addUsingAlias(RecordTableMap::COL_UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
660
                $useMinMax = true;
661
            }
662
            if (isset($updatedAt['max'])) {
663
                $this->addUsingAlias(RecordTableMap::COL_UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
664
                $useMinMax = true;
665
            }
666
            if ($useMinMax) {
667
                return $this;
668
            }
669
            if (null === $comparison) {
670
                $comparison = Criteria::IN;
671
            }
672
        }
673
674
        return $this->addUsingAlias(RecordTableMap::COL_UPDATED_AT, $updatedAt, $comparison);
675
    }
676
677
    /**
678
     * Filter the query by a related \eXpansion\Framework\PlayersBundle\Model\Player object

src/eXpansion/Framework/PlayersBundle/Model/Base/PlayerQuery.php 4 locations

@@ 301-322 (lines=22) @@
298
     *
299
     * @return $this|ChildPlayerQuery The current query, for fluid interface
300
     */
301
    public function filterById($id = null, $comparison = null)
302
    {
303
        if (is_array($id)) {
304
            $useMinMax = false;
305
            if (isset($id['min'])) {
306
                $this->addUsingAlias(PlayerTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);
307
                $useMinMax = true;
308
            }
309
            if (isset($id['max'])) {
310
                $this->addUsingAlias(PlayerTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);
311
                $useMinMax = true;
312
            }
313
            if ($useMinMax) {
314
                return $this;
315
            }
316
            if (null === $comparison) {
317
                $comparison = Criteria::IN;
318
            }
319
        }
320
321
        return $this->addUsingAlias(PlayerTableMap::COL_ID, $id, $comparison);
322
    }
323
324
    /**
325
     * Filter the query on the login column
@@ 442-463 (lines=22) @@
439
     *
440
     * @return $this|ChildPlayerQuery The current query, for fluid interface
441
     */
442
    public function filterByWins($wins = null, $comparison = null)
443
    {
444
        if (is_array($wins)) {
445
            $useMinMax = false;
446
            if (isset($wins['min'])) {
447
                $this->addUsingAlias(PlayerTableMap::COL_WINS, $wins['min'], Criteria::GREATER_EQUAL);
448
                $useMinMax = true;
449
            }
450
            if (isset($wins['max'])) {
451
                $this->addUsingAlias(PlayerTableMap::COL_WINS, $wins['max'], Criteria::LESS_EQUAL);
452
                $useMinMax = true;
453
            }
454
            if ($useMinMax) {
455
                return $this;
456
            }
457
            if (null === $comparison) {
458
                $comparison = Criteria::IN;
459
            }
460
        }
461
462
        return $this->addUsingAlias(PlayerTableMap::COL_WINS, $wins, $comparison);
463
    }
464
465
    /**
466
     * Filter the query on the online_time column
@@ 483-504 (lines=22) @@
480
     *
481
     * @return $this|ChildPlayerQuery The current query, for fluid interface
482
     */
483
    public function filterByOnlineTime($onlineTime = null, $comparison = null)
484
    {
485
        if (is_array($onlineTime)) {
486
            $useMinMax = false;
487
            if (isset($onlineTime['min'])) {
488
                $this->addUsingAlias(PlayerTableMap::COL_ONLINE_TIME, $onlineTime['min'], Criteria::GREATER_EQUAL);
489
                $useMinMax = true;
490
            }
491
            if (isset($onlineTime['max'])) {
492
                $this->addUsingAlias(PlayerTableMap::COL_ONLINE_TIME, $onlineTime['max'], Criteria::LESS_EQUAL);
493
                $useMinMax = true;
494
            }
495
            if ($useMinMax) {
496
                return $this;
497
            }
498
            if (null === $comparison) {
499
                $comparison = Criteria::IN;
500
            }
501
        }
502
503
        return $this->addUsingAlias(PlayerTableMap::COL_ONLINE_TIME, $onlineTime, $comparison);
504
    }
505
506
    /**
507
     * Filter the query on the last_online column
@@ 526-547 (lines=22) @@
523
     *
524
     * @return $this|ChildPlayerQuery The current query, for fluid interface
525
     */
526
    public function filterByLastOnline($lastOnline = null, $comparison = null)
527
    {
528
        if (is_array($lastOnline)) {
529
            $useMinMax = false;
530
            if (isset($lastOnline['min'])) {
531
                $this->addUsingAlias(PlayerTableMap::COL_LAST_ONLINE, $lastOnline['min'], Criteria::GREATER_EQUAL);
532
                $useMinMax = true;
533
            }
534
            if (isset($lastOnline['max'])) {
535
                $this->addUsingAlias(PlayerTableMap::COL_LAST_ONLINE, $lastOnline['max'], Criteria::LESS_EQUAL);
536
                $useMinMax = true;
537
            }
538
            if ($useMinMax) {
539
                return $this;
540
            }
541
            if (null === $comparison) {
542
                $comparison = Criteria::IN;
543
            }
544
        }
545
546
        return $this->addUsingAlias(PlayerTableMap::COL_LAST_ONLINE, $lastOnline, $comparison);
547
    }
548
549
    /**
550
     * Filter the query by a related \eXpansion\Bundle\LocalRecords\Model\Record object