Code Duplication    Length = 16-16 lines in 7 locations

src/cli/Database/Base/ChannelQuery.php 1 location

@@ 370-385 (lines=16) @@
367
     *
368
     * @return ChildChannelQuery The current query, for fluid interface
369
     */
370
    public function filterByInstance($instance, $comparison = null)
371
    {
372
        if ($instance instanceof \Jalle19\StatusManager\Database\Instance) {
373
            return $this
374
                ->addUsingAlias(ChannelTableMap::COL_INSTANCE_NAME, $instance->getName(), $comparison);
375
        } elseif ($instance instanceof ObjectCollection) {
376
            if (null === $comparison) {
377
                $comparison = Criteria::IN;
378
            }
379
380
            return $this
381
                ->addUsingAlias(ChannelTableMap::COL_INSTANCE_NAME, $instance->toKeyValue('PrimaryKey', 'Name'), $comparison);
382
        } else {
383
            throw new PropelException('filterByInstance() only accepts arguments of type \Jalle19\StatusManager\Database\Instance or Collection');
384
        }
385
    }
386
387
    /**
388
     * Adds a JOIN clause to the query using the Instance relation

src/cli/Database/Base/ConnectionQuery.php 2 locations

@@ 500-515 (lines=16) @@
497
     *
498
     * @return ChildConnectionQuery The current query, for fluid interface
499
     */
500
    public function filterByInstance($instance, $comparison = null)
501
    {
502
        if ($instance instanceof \Jalle19\StatusManager\Database\Instance) {
503
            return $this
504
                ->addUsingAlias(ConnectionTableMap::COL_INSTANCE_NAME, $instance->getName(), $comparison);
505
        } elseif ($instance instanceof ObjectCollection) {
506
            if (null === $comparison) {
507
                $comparison = Criteria::IN;
508
            }
509
510
            return $this
511
                ->addUsingAlias(ConnectionTableMap::COL_INSTANCE_NAME, $instance->toKeyValue('PrimaryKey', 'Name'), $comparison);
512
        } else {
513
            throw new PropelException('filterByInstance() only accepts arguments of type \Jalle19\StatusManager\Database\Instance or Collection');
514
        }
515
    }
516
517
    /**
518
     * Adds a JOIN clause to the query using the Instance relation
@@ 577-592 (lines=16) @@
574
     *
575
     * @return ChildConnectionQuery The current query, for fluid interface
576
     */
577
    public function filterByUser($user, $comparison = null)
578
    {
579
        if ($user instanceof \Jalle19\StatusManager\Database\User) {
580
            return $this
581
                ->addUsingAlias(ConnectionTableMap::COL_USER_ID, $user->getId(), $comparison);
582
        } elseif ($user instanceof ObjectCollection) {
583
            if (null === $comparison) {
584
                $comparison = Criteria::IN;
585
            }
586
587
            return $this
588
                ->addUsingAlias(ConnectionTableMap::COL_USER_ID, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);
589
        } else {
590
            throw new PropelException('filterByUser() only accepts arguments of type \Jalle19\StatusManager\Database\User or Collection');
591
        }
592
    }
593
594
    /**
595
     * Adds a JOIN clause to the query using the User relation

src/cli/Database/Base/SubscriptionQuery.php 3 locations

@@ 652-667 (lines=16) @@
649
     *
650
     * @return ChildSubscriptionQuery The current query, for fluid interface
651
     */
652
    public function filterByInstance($instance, $comparison = null)
653
    {
654
        if ($instance instanceof \Jalle19\StatusManager\Database\Instance) {
655
            return $this
656
                ->addUsingAlias(SubscriptionTableMap::COL_INSTANCE_NAME, $instance->getName(), $comparison);
657
        } elseif ($instance instanceof ObjectCollection) {
658
            if (null === $comparison) {
659
                $comparison = Criteria::IN;
660
            }
661
662
            return $this
663
                ->addUsingAlias(SubscriptionTableMap::COL_INSTANCE_NAME, $instance->toKeyValue('PrimaryKey', 'Name'), $comparison);
664
        } else {
665
            throw new PropelException('filterByInstance() only accepts arguments of type \Jalle19\StatusManager\Database\Instance or Collection');
666
        }
667
    }
668
669
    /**
670
     * Adds a JOIN clause to the query using the Instance relation
@@ 729-744 (lines=16) @@
726
     *
727
     * @return ChildSubscriptionQuery The current query, for fluid interface
728
     */
729
    public function filterByUser($user, $comparison = null)
730
    {
731
        if ($user instanceof \Jalle19\StatusManager\Database\User) {
732
            return $this
733
                ->addUsingAlias(SubscriptionTableMap::COL_USER_ID, $user->getId(), $comparison);
734
        } elseif ($user instanceof ObjectCollection) {
735
            if (null === $comparison) {
736
                $comparison = Criteria::IN;
737
            }
738
739
            return $this
740
                ->addUsingAlias(SubscriptionTableMap::COL_USER_ID, $user->toKeyValue('PrimaryKey', 'Id'), $comparison);
741
        } else {
742
            throw new PropelException('filterByUser() only accepts arguments of type \Jalle19\StatusManager\Database\User or Collection');
743
        }
744
    }
745
746
    /**
747
     * Adds a JOIN clause to the query using the User relation
@@ 806-821 (lines=16) @@
803
     *
804
     * @return ChildSubscriptionQuery The current query, for fluid interface
805
     */
806
    public function filterByChannel($channel, $comparison = null)
807
    {
808
        if ($channel instanceof \Jalle19\StatusManager\Database\Channel) {
809
            return $this
810
                ->addUsingAlias(SubscriptionTableMap::COL_CHANNEL_ID, $channel->getId(), $comparison);
811
        } elseif ($channel instanceof ObjectCollection) {
812
            if (null === $comparison) {
813
                $comparison = Criteria::IN;
814
            }
815
816
            return $this
817
                ->addUsingAlias(SubscriptionTableMap::COL_CHANNEL_ID, $channel->toKeyValue('PrimaryKey', 'Id'), $comparison);
818
        } else {
819
            throw new PropelException('filterByChannel() only accepts arguments of type \Jalle19\StatusManager\Database\Channel or Collection');
820
        }
821
    }
822
823
    /**
824
     * Adds a JOIN clause to the query using the Channel relation

src/cli/Database/Base/UserQuery.php 1 location

@@ 380-395 (lines=16) @@
377
     *
378
     * @return ChildUserQuery The current query, for fluid interface
379
     */
380
    public function filterByInstance($instance, $comparison = null)
381
    {
382
        if ($instance instanceof \Jalle19\StatusManager\Database\Instance) {
383
            return $this
384
                ->addUsingAlias(UserTableMap::COL_INSTANCE_NAME, $instance->getName(), $comparison);
385
        } elseif ($instance instanceof ObjectCollection) {
386
            if (null === $comparison) {
387
                $comparison = Criteria::IN;
388
            }
389
390
            return $this
391
                ->addUsingAlias(UserTableMap::COL_INSTANCE_NAME, $instance->toKeyValue('PrimaryKey', 'Name'), $comparison);
392
        } else {
393
            throw new PropelException('filterByInstance() only accepts arguments of type \Jalle19\StatusManager\Database\Instance or Collection');
394
        }
395
    }
396
397
    /**
398
     * Adds a JOIN clause to the query using the Instance relation