Code Duplication    Length = 20-20 lines in 5 locations

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

@@ 532-551 (lines=20) @@
529
     * @param ConnectionInterface $con the connection to use
530
     * @return int The number of affected rows (if supported by underlying database driver).
531
     */
532
    public function doDeleteAll(ConnectionInterface $con = null)
533
    {
534
        if (null === $con) {
535
            $con = Propel::getServiceContainer()->getWriteConnection(ChannelTableMap::DATABASE_NAME);
536
        }
537
538
        // use transaction because $criteria could contain info
539
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
540
        return $con->transaction(function () use ($con) {
541
            $affectedRows = 0; // initialize var to track total num of affected rows
542
            $affectedRows += parent::doDeleteAll($con);
543
            // Because this db requires some delete cascade/set null emulation, we have to
544
            // clear the cached instance *after* the emulation has happened (since
545
            // instances get re-added by the select statement contained therein).
546
            ChannelTableMap::clearInstancePool();
547
            ChannelTableMap::clearRelatedInstancePool();
548
549
            return $affectedRows;
550
        });
551
    }
552
553
    /**
554
     * Performs a DELETE on the database based on the current ModelCriteria

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

@@ 666-685 (lines=20) @@
663
     * @param ConnectionInterface $con the connection to use
664
     * @return int The number of affected rows (if supported by underlying database driver).
665
     */
666
    public function doDeleteAll(ConnectionInterface $con = null)
667
    {
668
        if (null === $con) {
669
            $con = Propel::getServiceContainer()->getWriteConnection(ConnectionTableMap::DATABASE_NAME);
670
        }
671
672
        // use transaction because $criteria could contain info
673
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
674
        return $con->transaction(function () use ($con) {
675
            $affectedRows = 0; // initialize var to track total num of affected rows
676
            $affectedRows += parent::doDeleteAll($con);
677
            // Because this db requires some delete cascade/set null emulation, we have to
678
            // clear the cached instance *after* the emulation has happened (since
679
            // instances get re-added by the select statement contained therein).
680
            ConnectionTableMap::clearInstancePool();
681
            ConnectionTableMap::clearRelatedInstancePool();
682
683
            return $affectedRows;
684
        });
685
    }
686
687
    /**
688
     * Performs a DELETE on the database based on the current ModelCriteria

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

@@ 614-633 (lines=20) @@
611
     * @param ConnectionInterface $con the connection to use
612
     * @return int The number of affected rows (if supported by underlying database driver).
613
     */
614
    public function doDeleteAll(ConnectionInterface $con = null)
615
    {
616
        if (null === $con) {
617
            $con = Propel::getServiceContainer()->getWriteConnection(InstanceTableMap::DATABASE_NAME);
618
        }
619
620
        // use transaction because $criteria could contain info
621
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
622
        return $con->transaction(function () use ($con) {
623
            $affectedRows = 0; // initialize var to track total num of affected rows
624
            $affectedRows += parent::doDeleteAll($con);
625
            // Because this db requires some delete cascade/set null emulation, we have to
626
            // clear the cached instance *after* the emulation has happened (since
627
            // instances get re-added by the select statement contained therein).
628
            InstanceTableMap::clearInstancePool();
629
            InstanceTableMap::clearRelatedInstancePool();
630
631
            return $affectedRows;
632
        });
633
    }
634
635
    /**
636
     * Performs a DELETE on the database based on the current ModelCriteria

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

@@ 895-914 (lines=20) @@
892
     * @param ConnectionInterface $con the connection to use
893
     * @return int The number of affected rows (if supported by underlying database driver).
894
     */
895
    public function doDeleteAll(ConnectionInterface $con = null)
896
    {
897
        if (null === $con) {
898
            $con = Propel::getServiceContainer()->getWriteConnection(SubscriptionTableMap::DATABASE_NAME);
899
        }
900
901
        // use transaction because $criteria could contain info
902
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
903
        return $con->transaction(function () use ($con) {
904
            $affectedRows = 0; // initialize var to track total num of affected rows
905
            $affectedRows += parent::doDeleteAll($con);
906
            // Because this db requires some delete cascade/set null emulation, we have to
907
            // clear the cached instance *after* the emulation has happened (since
908
            // instances get re-added by the select statement contained therein).
909
            SubscriptionTableMap::clearInstancePool();
910
            SubscriptionTableMap::clearRelatedInstancePool();
911
912
            return $affectedRows;
913
        });
914
    }
915
916
    /**
917
     * Performs a DELETE on the database based on the current ModelCriteria

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

@@ 615-634 (lines=20) @@
612
     * @param ConnectionInterface $con the connection to use
613
     * @return int The number of affected rows (if supported by underlying database driver).
614
     */
615
    public function doDeleteAll(ConnectionInterface $con = null)
616
    {
617
        if (null === $con) {
618
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
619
        }
620
621
        // use transaction because $criteria could contain info
622
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
623
        return $con->transaction(function () use ($con) {
624
            $affectedRows = 0; // initialize var to track total num of affected rows
625
            $affectedRows += parent::doDeleteAll($con);
626
            // Because this db requires some delete cascade/set null emulation, we have to
627
            // clear the cached instance *after* the emulation has happened (since
628
            // instances get re-added by the select statement contained therein).
629
            UserTableMap::clearInstancePool();
630
            UserTableMap::clearRelatedInstancePool();
631
632
            return $affectedRows;
633
        });
634
    }
635
636
    /**
637
     * Performs a DELETE on the database based on the current ModelCriteria