Code Duplication    Length = 20-24 lines in 7 locations

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

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

application/modules/xbanners/models/Base/BannerImageI18nQuery.php 2 locations

@@ 569-588 (lines=20) @@
566
     * @param ConnectionInterface $con the connection to use
567
     * @return int The number of affected rows (if supported by underlying database driver).
568
     */
569
    public function doDeleteAll(ConnectionInterface $con = null)
570
    {
571
        if (null === $con) {
572
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
573
        }
574
575
        // use transaction because $criteria could contain info
576
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
577
        return $con->transaction(function () use ($con) {
578
            $affectedRows = 0; // initialize var to track total num of affected rows
579
            $affectedRows += parent::doDeleteAll($con);
580
            // Because this db requires some delete cascade/set null emulation, we have to
581
            // clear the cached instance *after* the emulation has happened (since
582
            // instances get re-added by the select statement contained therein).
583
            BannerImageI18nTableMap::clearInstancePool();
584
            BannerImageI18nTableMap::clearRelatedInstancePool();
585
586
            return $affectedRows;
587
        });
588
    }
589
590
    /**
591
     * Performs a DELETE on the database based on the current ModelCriteria
@@ 599-622 (lines=24) @@
596
     * @throws PropelException Any exceptions caught during processing will be
597
     *                         rethrown wrapped into a PropelException.
598
     */
599
    public function delete(ConnectionInterface $con = null)
600
    {
601
        if (null === $con) {
602
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
603
        }
604
605
        $criteria = $this;
606
607
        // Set the correct dbName
608
        $criteria->setDbName(BannerImageI18nTableMap::DATABASE_NAME);
609
610
        // use transaction because $criteria could contain info
611
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
612
        return $con->transaction(function () use ($con, $criteria) {
613
            $affectedRows = 0; // initialize var to track total num of affected rows
614
615
            BannerImageI18nTableMap::removeInstanceFromPool($criteria);
616
617
            $affectedRows += ModelCriteria::delete($con);
618
            BannerImageI18nTableMap::clearRelatedInstancePool();
619
620
            return $affectedRows;
621
        });
622
    }
623
624
} // BannerImageI18nQuery
625

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

@@ 872-892 (lines=21) @@
869
     * @param ConnectionInterface $con the connection to use
870
     * @return int The number of affected rows (if supported by underlying database driver).
871
     */
872
    public function doDeleteAll(ConnectionInterface $con = null)
873
    {
874
        if (null === $con) {
875
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
876
        }
877
878
        // use transaction because $criteria could contain info
879
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
880
        return $con->transaction(function () use ($con) {
881
            $affectedRows = 0; // initialize var to track total num of affected rows
882
            $affectedRows += $this->doOnDeleteCascade($con);
883
            $affectedRows += parent::doDeleteAll($con);
884
            // Because this db requires some delete cascade/set null emulation, we have to
885
            // clear the cached instance *after* the emulation has happened (since
886
            // instances get re-added by the select statement contained therein).
887
            BannerImageTableMap::clearInstancePool();
888
            BannerImageTableMap::clearRelatedInstancePool();
889
890
            return $affectedRows;
891
        });
892
    }
893
894
    /**
895
     * Performs a DELETE on the database based on the current ModelCriteria

application/modules/xbanners/models/Base/BannersI18nQuery.php 2 locations

@@ 463-482 (lines=20) @@
460
     * @param ConnectionInterface $con the connection to use
461
     * @return int The number of affected rows (if supported by underlying database driver).
462
     */
463
    public function doDeleteAll(ConnectionInterface $con = null)
464
    {
465
        if (null === $con) {
466
            $con = Propel::getServiceContainer()->getWriteConnection(BannersI18nTableMap::DATABASE_NAME);
467
        }
468
469
        // use transaction because $criteria could contain info
470
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
471
        return $con->transaction(function () use ($con) {
472
            $affectedRows = 0; // initialize var to track total num of affected rows
473
            $affectedRows += parent::doDeleteAll($con);
474
            // Because this db requires some delete cascade/set null emulation, we have to
475
            // clear the cached instance *after* the emulation has happened (since
476
            // instances get re-added by the select statement contained therein).
477
            BannersI18nTableMap::clearInstancePool();
478
            BannersI18nTableMap::clearRelatedInstancePool();
479
480
            return $affectedRows;
481
        });
482
    }
483
484
    /**
485
     * Performs a DELETE on the database based on the current ModelCriteria
@@ 493-516 (lines=24) @@
490
     * @throws PropelException Any exceptions caught during processing will be
491
     *                         rethrown wrapped into a PropelException.
492
     */
493
    public function delete(ConnectionInterface $con = null)
494
    {
495
        if (null === $con) {
496
            $con = Propel::getServiceContainer()->getWriteConnection(BannersI18nTableMap::DATABASE_NAME);
497
        }
498
499
        $criteria = $this;
500
501
        // Set the correct dbName
502
        $criteria->setDbName(BannersI18nTableMap::DATABASE_NAME);
503
504
        // use transaction because $criteria could contain info
505
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
506
        return $con->transaction(function () use ($con, $criteria) {
507
            $affectedRows = 0; // initialize var to track total num of affected rows
508
509
            BannersI18nTableMap::removeInstanceFromPool($criteria);
510
511
            $affectedRows += ModelCriteria::delete($con);
512
            BannersI18nTableMap::clearRelatedInstancePool();
513
514
            return $affectedRows;
515
        });
516
    }
517
518
} // BannersI18nQuery
519

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

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