| @@ 806-829 (lines=24) @@ | ||
| 803 | * @throws PropelException Any exceptions caught during processing will be |
|
| 804 | * rethrown wrapped into a PropelException. |
|
| 805 | */ |
|
| 806 | public function delete(ConnectionInterface $con = null) |
|
| 807 | { |
|
| 808 | if (null === $con) { |
|
| 809 | $con = Propel::getServiceContainer()->getWriteConnection(RecordTableMap::DATABASE_NAME); |
|
| 810 | } |
|
| 811 | ||
| 812 | $criteria = $this; |
|
| 813 | ||
| 814 | // Set the correct dbName |
|
| 815 | $criteria->setDbName(RecordTableMap::DATABASE_NAME); |
|
| 816 | ||
| 817 | // use transaction because $criteria could contain info |
|
| 818 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 819 | return $con->transaction(function () use ($con, $criteria) { |
|
| 820 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 821 | ||
| 822 | RecordTableMap::removeInstanceFromPool($criteria); |
|
| 823 | ||
| 824 | $affectedRows += ModelCriteria::delete($con); |
|
| 825 | RecordTableMap::clearRelatedInstancePool(); |
|
| 826 | ||
| 827 | return $affectedRows; |
|
| 828 | }); |
|
| 829 | } |
|
| 830 | ||
| 831 | // timestampable behavior |
|
| 832 | ||
| @@ 674-697 (lines=24) @@ | ||
| 671 | * @throws PropelException Any exceptions caught during processing will be |
|
| 672 | * rethrown wrapped into a PropelException. |
|
| 673 | */ |
|
| 674 | public function delete(ConnectionInterface $con = null) |
|
| 675 | { |
|
| 676 | if (null === $con) { |
|
| 677 | $con = Propel::getServiceContainer()->getWriteConnection(PlayerTableMap::DATABASE_NAME); |
|
| 678 | } |
|
| 679 | ||
| 680 | $criteria = $this; |
|
| 681 | ||
| 682 | // Set the correct dbName |
|
| 683 | $criteria->setDbName(PlayerTableMap::DATABASE_NAME); |
|
| 684 | ||
| 685 | // use transaction because $criteria could contain info |
|
| 686 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 687 | return $con->transaction(function () use ($con, $criteria) { |
|
| 688 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 689 | ||
| 690 | PlayerTableMap::removeInstanceFromPool($criteria); |
|
| 691 | ||
| 692 | $affectedRows += ModelCriteria::delete($con); |
|
| 693 | PlayerTableMap::clearRelatedInstancePool(); |
|
| 694 | ||
| 695 | return $affectedRows; |
|
| 696 | }); |
|
| 697 | } |
|
| 698 | ||
| 699 | } // PlayerQuery |
|
| 700 | ||