| @@ 615-638 (lines=24) @@ | ||
| 612 | * @throws PropelException Any exceptions caught during processing will be |
|
| 613 | * rethrown wrapped into a PropelException. |
|
| 614 | */ |
|
| 615 | public function delete(ConnectionInterface $con = null) |
|
| 616 | { |
|
| 617 | if (null === $con) { |
|
| 618 | $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME); |
|
| 619 | } |
|
| 620 | ||
| 621 | $criteria = $this; |
|
| 622 | ||
| 623 | // Set the correct dbName |
|
| 624 | $criteria->setDbName(BannerImageI18nTableMap::DATABASE_NAME); |
|
| 625 | ||
| 626 | // use transaction because $criteria could contain info |
|
| 627 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 628 | return $con->transaction(function () use ($con, $criteria) { |
|
| 629 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 630 | ||
| 631 | BannerImageI18nTableMap::removeInstanceFromPool($criteria); |
|
| 632 | ||
| 633 | $affectedRows += ModelCriteria::delete($con); |
|
| 634 | BannerImageI18nTableMap::clearRelatedInstancePool(); |
|
| 635 | ||
| 636 | return $affectedRows; |
|
| 637 | }); |
|
| 638 | } |
|
| 639 | ||
| 640 | } // BannerImageI18nQuery |
|
| 641 | ||
| @@ 876-896 (lines=21) @@ | ||
| 873 | * @param ConnectionInterface $con the connection to use |
|
| 874 | * @return int The number of affected rows (if supported by underlying database driver). |
|
| 875 | */ |
|
| 876 | public function doDeleteAll(ConnectionInterface $con = null) |
|
| 877 | { |
|
| 878 | if (null === $con) { |
|
| 879 | $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME); |
|
| 880 | } |
|
| 881 | ||
| 882 | // use transaction because $criteria could contain info |
|
| 883 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 884 | return $con->transaction(function () use ($con) { |
|
| 885 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 886 | $affectedRows += $this->doOnDeleteCascade($con); |
|
| 887 | $affectedRows += parent::doDeleteAll($con); |
|
| 888 | // Because this db requires some delete cascade/set null emulation, we have to |
|
| 889 | // clear the cached instance *after* the emulation has happened (since |
|
| 890 | // instances get re-added by the select statement contained therein). |
|
| 891 | BannerImageTableMap::clearInstancePool(); |
|
| 892 | BannerImageTableMap::clearRelatedInstancePool(); |
|
| 893 | ||
| 894 | return $affectedRows; |
|
| 895 | }); |
|
| 896 | } |
|
| 897 | ||
| 898 | /** |
|
| 899 | * Performs a DELETE on the database based on the current ModelCriteria |
|
| @@ 501-524 (lines=24) @@ | ||
| 498 | * @throws PropelException Any exceptions caught during processing will be |
|
| 499 | * rethrown wrapped into a PropelException. |
|
| 500 | */ |
|
| 501 | public function delete(ConnectionInterface $con = null) |
|
| 502 | { |
|
| 503 | if (null === $con) { |
|
| 504 | $con = Propel::getServiceContainer()->getWriteConnection(BannersI18nTableMap::DATABASE_NAME); |
|
| 505 | } |
|
| 506 | ||
| 507 | $criteria = $this; |
|
| 508 | ||
| 509 | // Set the correct dbName |
|
| 510 | $criteria->setDbName(BannersI18nTableMap::DATABASE_NAME); |
|
| 511 | ||
| 512 | // use transaction because $criteria could contain info |
|
| 513 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 514 | return $con->transaction(function () use ($con, $criteria) { |
|
| 515 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 516 | ||
| 517 | BannersI18nTableMap::removeInstanceFromPool($criteria); |
|
| 518 | ||
| 519 | $affectedRows += ModelCriteria::delete($con); |
|
| 520 | BannersI18nTableMap::clearRelatedInstancePool(); |
|
| 521 | ||
| 522 | return $affectedRows; |
|
| 523 | }); |
|
| 524 | } |
|
| 525 | ||
| 526 | } // BannersI18nQuery |
|
| 527 | ||
| @@ 663-683 (lines=21) @@ | ||
| 660 | * @param ConnectionInterface $con the connection to use |
|
| 661 | * @return int The number of affected rows (if supported by underlying database driver). |
|
| 662 | */ |
|
| 663 | public function doDeleteAll(ConnectionInterface $con = null) |
|
| 664 | { |
|
| 665 | if (null === $con) { |
|
| 666 | $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME); |
|
| 667 | } |
|
| 668 | ||
| 669 | // use transaction because $criteria could contain info |
|
| 670 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 671 | return $con->transaction(function () use ($con) { |
|
| 672 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 673 | $affectedRows += $this->doOnDeleteCascade($con); |
|
| 674 | $affectedRows += parent::doDeleteAll($con); |
|
| 675 | // Because this db requires some delete cascade/set null emulation, we have to |
|
| 676 | // clear the cached instance *after* the emulation has happened (since |
|
| 677 | // instances get re-added by the select statement contained therein). |
|
| 678 | BannersTableMap::clearInstancePool(); |
|
| 679 | BannersTableMap::clearRelatedInstancePool(); |
|
| 680 | ||
| 681 | return $affectedRows; |
|
| 682 | }); |
|
| 683 | } |
|
| 684 | ||
| 685 | /** |
|
| 686 | * Performs a DELETE on the database based on the current ModelCriteria |
|