Code Duplication    Length = 28-28 lines in 3 locations

application/modules/core/models/Base/RouteQuery.php 1 location

@@ 637-664 (lines=28) @@
634
     * @throws PropelException Any exceptions caught during processing will be
635
     *                         rethrown wrapped into a PropelException.
636
     */
637
    public function delete(ConnectionInterface $con = null)
638
    {
639
        if (null === $con) {
640
            $con = Propel::getServiceContainer()->getWriteConnection(RouteTableMap::DATABASE_NAME);
641
        }
642
643
        $criteria = $this;
644
645
        // Set the correct dbName
646
        $criteria->setDbName(RouteTableMap::DATABASE_NAME);
647
648
        // use transaction because $criteria could contain info
649
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
650
        return $con->transaction(function () use ($con, $criteria) {
651
            $affectedRows = 0; // initialize var to track total num of affected rows
652
653
            // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
654
            $c = clone $criteria;
655
            $affectedRows += $c->doOnDeleteCascade($con);
656
657
            RouteTableMap::removeInstanceFromPool($criteria);
658
659
            $affectedRows += ModelCriteria::delete($con);
660
            RouteTableMap::clearRelatedInstancePool();
661
662
            return $affectedRows;
663
        });
664
    }
665
666
    /**
667
     * This is a method for emulating ON DELETE CASCADE for DBs that don't support this

application/modules/xbanners/models/Base/BannerImageQuery.php 1 location

@@ 903-930 (lines=28) @@
900
     * @throws PropelException Any exceptions caught during processing will be
901
     *                         rethrown wrapped into a PropelException.
902
     */
903
    public function delete(ConnectionInterface $con = null)
904
    {
905
        if (null === $con) {
906
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
907
        }
908
909
        $criteria = $this;
910
911
        // Set the correct dbName
912
        $criteria->setDbName(BannerImageTableMap::DATABASE_NAME);
913
914
        // use transaction because $criteria could contain info
915
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
916
        return $con->transaction(function () use ($con, $criteria) {
917
            $affectedRows = 0; // initialize var to track total num of affected rows
918
919
            // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
920
            $c = clone $criteria;
921
            $affectedRows += $c->doOnDeleteCascade($con);
922
923
            BannerImageTableMap::removeInstanceFromPool($criteria);
924
925
            $affectedRows += ModelCriteria::delete($con);
926
            BannerImageTableMap::clearRelatedInstancePool();
927
928
            return $affectedRows;
929
        });
930
    }
931
932
    /**
933
     * This is a method for emulating ON DELETE CASCADE for DBs that don't support this

application/modules/xbanners/models/Base/BannersQuery.php 1 location

@@ 682-709 (lines=28) @@
679
     * @throws PropelException Any exceptions caught during processing will be
680
     *                         rethrown wrapped into a PropelException.
681
     */
682
    public function delete(ConnectionInterface $con = null)
683
    {
684
        if (null === $con) {
685
            $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME);
686
        }
687
688
        $criteria = $this;
689
690
        // Set the correct dbName
691
        $criteria->setDbName(BannersTableMap::DATABASE_NAME);
692
693
        // use transaction because $criteria could contain info
694
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
695
        return $con->transaction(function () use ($con, $criteria) {
696
            $affectedRows = 0; // initialize var to track total num of affected rows
697
698
            // cloning the Criteria in case it's modified by doSelect() or doSelectStmt()
699
            $c = clone $criteria;
700
            $affectedRows += $c->doOnDeleteCascade($con);
701
702
            BannersTableMap::removeInstanceFromPool($criteria);
703
704
            $affectedRows += ModelCriteria::delete($con);
705
            BannersTableMap::clearRelatedInstancePool();
706
707
            return $affectedRows;
708
        });
709
    }
710
711
    /**
712
     * This is a method for emulating ON DELETE CASCADE for DBs that don't support this