| @@ 432-453 (lines=22) @@ | ||
| 429 | * @throws PropelException Any exceptions caught during processing will be |
|
| 430 | * rethrown wrapped into a PropelException. |
|
| 431 | */ |
|
| 432 | public static function doInsert($criteria, ConnectionInterface $con = null) |
|
| 433 | { |
|
| 434 | if (null === $con) { |
|
| 435 | $con = Propel::getServiceContainer()->getWriteConnection(InputTableMap::DATABASE_NAME); |
|
| 436 | } |
|
| 437 | ||
| 438 | if ($criteria instanceof Criteria) { |
|
| 439 | $criteria = clone $criteria; // rename for clarity |
|
| 440 | } else { |
|
| 441 | $criteria = $criteria->buildCriteria(); // build Criteria from Input object |
|
| 442 | } |
|
| 443 | ||
| 444 | ||
| 445 | // Set the correct dbName |
|
| 446 | $query = InputQuery::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 | } // InputTableMap |
|
| 456 | // This is the static code needed to register the TableMap for this table with the main Propel class. |
|
| @@ 405-426 (lines=22) @@ | ||
| 402 | * @throws PropelException Any exceptions caught during processing will be |
|
| 403 | * rethrown wrapped into a PropelException. |
|
| 404 | */ |
|
| 405 | public static function doInsert($criteria, ConnectionInterface $con = null) |
|
| 406 | { |
|
| 407 | if (null === $con) { |
|
| 408 | $con = Propel::getServiceContainer()->getWriteConnection(InstanceTableMap::DATABASE_NAME); |
|
| 409 | } |
|
| 410 | ||
| 411 | if ($criteria instanceof Criteria) { |
|
| 412 | $criteria = clone $criteria; // rename for clarity |
|
| 413 | } else { |
|
| 414 | $criteria = $criteria->buildCriteria(); // build Criteria from Instance object |
|
| 415 | } |
|
| 416 | ||
| 417 | ||
| 418 | // Set the correct dbName |
|
| 419 | $query = InstanceQuery::create()->mergeWith($criteria); |
|
| 420 | ||
| 421 | // use transaction because $criteria could contain info |
|
| 422 | // for more than one table (I guess, conceivably) |
|
| 423 | return $con->transaction(function () use ($con, $query) { |
|
| 424 | return $query->doInsert($con); |
|
| 425 | }); |
|
| 426 | } |
|
| 427 | ||
| 428 | } // InstanceTableMap |
|
| 429 | // This is the static code needed to register the TableMap for this table with the main Propel class. |
|