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/mod_link/models/Map/PageLinkTableMap.php 1 location

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