Code Duplication    Length = 26-26 lines in 3 locations

application/modules/xbanners/models/Map/BannerImageTableMap.php 1 location

@@ 487-512 (lines=26) @@
484
     * @throws PropelException Any exceptions caught during processing will be
485
     *                         rethrown wrapped into a PropelException.
486
     */
487
    public static function doInsert($criteria, ConnectionInterface $con = null)
488
    {
489
        if (null === $con) {
490
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
491
        }
492
493
        if ($criteria instanceof Criteria) {
494
            $criteria = clone $criteria; // rename for clarity
495
        } else {
496
            $criteria = $criteria->buildCriteria(); // build Criteria from BannerImage object
497
        }
498
499
        if ($criteria->containsKey(BannerImageTableMap::COL_ID) && $criteria->keyContainsValue(BannerImageTableMap::COL_ID) ) {
500
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.BannerImageTableMap::COL_ID.')');
501
        }
502
503
504
        // Set the correct dbName
505
        $query = BannerImageQuery::create()->mergeWith($criteria);
506
507
        // use transaction because $criteria could contain info
508
        // for more than one table (I guess, conceivably)
509
        return $con->transaction(function () use ($con, $query) {
510
            return $query->doInsert($con);
511
        });
512
    }
513
514
} // BannerImageTableMap
515
// This is the static code needed to register the TableMap for this table with the main Propel class.

application/modules/xbanners/models/Map/BannersTableMap.php 1 location

@@ 456-481 (lines=26) @@
453
     * @throws PropelException Any exceptions caught during processing will be
454
     *                         rethrown wrapped into a PropelException.
455
     */
456
    public static function doInsert($criteria, ConnectionInterface $con = null)
457
    {
458
        if (null === $con) {
459
            $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME);
460
        }
461
462
        if ($criteria instanceof Criteria) {
463
            $criteria = clone $criteria; // rename for clarity
464
        } else {
465
            $criteria = $criteria->buildCriteria(); // build Criteria from Banners object
466
        }
467
468
        if ($criteria->containsKey(BannersTableMap::COL_ID) && $criteria->keyContainsValue(BannersTableMap::COL_ID) ) {
469
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.BannersTableMap::COL_ID.')');
470
        }
471
472
473
        // Set the correct dbName
474
        $query = BannersQuery::create()->mergeWith($criteria);
475
476
        // use transaction because $criteria could contain info
477
        // for more than one table (I guess, conceivably)
478
        return $con->transaction(function () use ($con, $query) {
479
            return $query->doInsert($con);
480
        });
481
    }
482
483
} // BannersTableMap
484
// This is the static code needed to register the TableMap for this table with the main Propel class.

application/modules/core/models/Map/RouteTableMap.php 1 location

@@ 428-453 (lines=26) @@
425
     * @throws PropelException Any exceptions caught during processing will be
426
     *                         rethrown wrapped into a PropelException.
427
     */
428
    public static function doInsert($criteria, ConnectionInterface $con = null)
429
    {
430
        if (null === $con) {
431
            $con = Propel::getServiceContainer()->getWriteConnection(RouteTableMap::DATABASE_NAME);
432
        }
433
434
        if ($criteria instanceof Criteria) {
435
            $criteria = clone $criteria; // rename for clarity
436
        } else {
437
            $criteria = $criteria->buildCriteria(); // build Criteria from Route object
438
        }
439
440
        if ($criteria->containsKey(RouteTableMap::COL_ID) && $criteria->keyContainsValue(RouteTableMap::COL_ID) ) {
441
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.RouteTableMap::COL_ID.')');
442
        }
443
444
445
        // Set the correct dbName
446
        $query = RouteQuery::create()->mergeWith($criteria);
447
448
        // use transaction because $criteria could contain info
449
        // for more than one table (I guess, conceivably)
450
        return $con->transaction(function () use ($con, $query) {
451
            return $query->doInsert($con);
452
        });
453
    }
454
455
} // RouteTableMap
456
// This is the static code needed to register the TableMap for this table with the main Propel class.