Code Duplication    Length = 21-24 lines in 4 locations

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

@@ 609-632 (lines=24) @@
606
     * @throws PropelException Any exceptions caught during processing will be
607
     *                         rethrown wrapped into a PropelException.
608
     */
609
    public function delete(ConnectionInterface $con = null)
610
    {
611
        if (null === $con) {
612
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
613
        }
614
615
        $criteria = $this;
616
617
        // Set the correct dbName
618
        $criteria->setDbName(BannerImageI18nTableMap::DATABASE_NAME);
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, $criteria) {
623
            $affectedRows = 0; // initialize var to track total num of affected rows
624
625
            BannerImageI18nTableMap::removeInstanceFromPool($criteria);
626
627
            $affectedRows += ModelCriteria::delete($con);
628
            BannerImageI18nTableMap::clearRelatedInstancePool();
629
630
            return $affectedRows;
631
        });
632
    }
633
634
} // BannerImageI18nQuery
635

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

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

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

@@ 495-518 (lines=24) @@
492
     * @throws PropelException Any exceptions caught during processing will be
493
     *                         rethrown wrapped into a PropelException.
494
     */
495
    public function delete(ConnectionInterface $con = null)
496
    {
497
        if (null === $con) {
498
            $con = Propel::getServiceContainer()->getWriteConnection(BannersI18nTableMap::DATABASE_NAME);
499
        }
500
501
        $criteria = $this;
502
503
        // Set the correct dbName
504
        $criteria->setDbName(BannersI18nTableMap::DATABASE_NAME);
505
506
        // use transaction because $criteria could contain info
507
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
508
        return $con->transaction(function () use ($con, $criteria) {
509
            $affectedRows = 0; // initialize var to track total num of affected rows
510
511
            BannersI18nTableMap::removeInstanceFromPool($criteria);
512
513
            $affectedRows += ModelCriteria::delete($con);
514
            BannersI18nTableMap::clearRelatedInstancePool();
515
516
            return $affectedRows;
517
        });
518
    }
519
520
} // BannersI18nQuery
521

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

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