Code Duplication    Length = 20-20 lines in 2 locations

src/eXpansion/Bundle/LocalRecords/Model/Base/RecordQuery.php 1 location

@@ 776-795 (lines=20) @@
773
     * @param ConnectionInterface $con the connection to use
774
     * @return int The number of affected rows (if supported by underlying database driver).
775
     */
776
    public function doDeleteAll(ConnectionInterface $con = null)
777
    {
778
        if (null === $con) {
779
            $con = Propel::getServiceContainer()->getWriteConnection(RecordTableMap::DATABASE_NAME);
780
        }
781
782
        // use transaction because $criteria could contain info
783
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
784
        return $con->transaction(function () use ($con) {
785
            $affectedRows = 0; // initialize var to track total num of affected rows
786
            $affectedRows += parent::doDeleteAll($con);
787
            // Because this db requires some delete cascade/set null emulation, we have to
788
            // clear the cached instance *after* the emulation has happened (since
789
            // instances get re-added by the select statement contained therein).
790
            RecordTableMap::clearInstancePool();
791
            RecordTableMap::clearRelatedInstancePool();
792
793
            return $affectedRows;
794
        });
795
    }
796
797
    /**
798
     * Performs a DELETE on the database based on the current ModelCriteria

src/eXpansion/Framework/PlayersBundle/Model/Base/PlayerQuery.php 1 location

@@ 644-663 (lines=20) @@
641
     * @param ConnectionInterface $con the connection to use
642
     * @return int The number of affected rows (if supported by underlying database driver).
643
     */
644
    public function doDeleteAll(ConnectionInterface $con = null)
645
    {
646
        if (null === $con) {
647
            $con = Propel::getServiceContainer()->getWriteConnection(PlayerTableMap::DATABASE_NAME);
648
        }
649
650
        // use transaction because $criteria could contain info
651
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
652
        return $con->transaction(function () use ($con) {
653
            $affectedRows = 0; // initialize var to track total num of affected rows
654
            $affectedRows += parent::doDeleteAll($con);
655
            // Because this db requires some delete cascade/set null emulation, we have to
656
            // clear the cached instance *after* the emulation has happened (since
657
            // instances get re-added by the select statement contained therein).
658
            PlayerTableMap::clearInstancePool();
659
            PlayerTableMap::clearRelatedInstancePool();
660
661
            return $affectedRows;
662
        });
663
    }
664
665
    /**
666
     * Performs a DELETE on the database based on the current ModelCriteria