Code Duplication    Length = 28-28 lines in 2 locations

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

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

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