Code Duplication    Length = 26-26 lines in 3 locations

packages/core/src/Models/Task/Map/TaskTableMap.php 1 location

@@ 386-411 (lines=26) @@
383
     * @throws PropelException Any exceptions caught during processing will be
384
     *                         rethrown wrapped into a PropelException.
385
     */
386
    public static function doInsert($criteria, ConnectionInterface $con = null)
387
    {
388
        if (null === $con) {
389
            $con = Propel::getServiceContainer()->getWriteConnection(TaskTableMap::DATABASE_NAME);
390
        }
391
392
        if ($criteria instanceof Criteria) {
393
            $criteria = clone $criteria; // rename for clarity
394
        } else {
395
            $criteria = $criteria->buildCriteria(); // build Criteria from Task object
396
        }
397
398
        if ($criteria->containsKey(TaskTableMap::COL_ID) && $criteria->keyContainsValue(TaskTableMap::COL_ID) ) {
399
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.TaskTableMap::COL_ID.')');
400
        }
401
402
403
        // Set the correct dbName
404
        $query = TaskQuery::create()->mergeWith($criteria);
405
406
        // use transaction because $criteria could contain info
407
        // for more than one table (I guess, conceivably)
408
        return $con->transaction(function () use ($con, $query) {
409
            return $query->doInsert($con);
410
        });
411
    }
412
413
} // TaskTableMap
414
// This is the static code needed to register the TableMap for this table with the main Propel class.

packages/core/src/Models/User/Map/UserTableMap.php 1 location

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

packages/selfprice/src/Models/Selfprice/Map/SelfpriceTableMap.php 1 location

@@ 394-419 (lines=26) @@
391
     * @throws PropelException Any exceptions caught during processing will be
392
     *                         rethrown wrapped into a PropelException.
393
     */
394
    public static function doInsert($criteria, ConnectionInterface $con = null)
395
    {
396
        if (null === $con) {
397
            $con = Propel::getServiceContainer()->getWriteConnection(SelfpriceTableMap::DATABASE_NAME);
398
        }
399
400
        if ($criteria instanceof Criteria) {
401
            $criteria = clone $criteria; // rename for clarity
402
        } else {
403
            $criteria = $criteria->buildCriteria(); // build Criteria from Selfprice object
404
        }
405
406
        if ($criteria->containsKey(SelfpriceTableMap::COL_ID) && $criteria->keyContainsValue(SelfpriceTableMap::COL_ID) ) {
407
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.SelfpriceTableMap::COL_ID.')');
408
        }
409
410
411
        // Set the correct dbName
412
        $query = SelfpriceQuery::create()->mergeWith($criteria);
413
414
        // use transaction because $criteria could contain info
415
        // for more than one table (I guess, conceivably)
416
        return $con->transaction(function () use ($con, $query) {
417
            return $query->doInsert($con);
418
        });
419
    }
420
421
} // SelfpriceTableMap
422
// This is the static code needed to register the TableMap for this table with the main Propel class.