| @@ 383-402 (lines=20) @@ | ||
| 380 | * @param ConnectionInterface $con the connection to use |
|
| 381 | * @return int The number of affected rows (if supported by underlying database driver). |
|
| 382 | */ |
|
| 383 | public function doDeleteAll(ConnectionInterface $con = null) |
|
| 384 | { |
|
| 385 | if (null === $con) { |
|
| 386 | $con = Propel::getServiceContainer()->getWriteConnection(TaskTableMap::DATABASE_NAME); |
|
| 387 | } |
|
| 388 | ||
| 389 | // use transaction because $criteria could contain info |
|
| 390 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 391 | return $con->transaction(function () use ($con) { |
|
| 392 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 393 | $affectedRows += parent::doDeleteAll($con); |
|
| 394 | // Because this db requires some delete cascade/set null emulation, we have to |
|
| 395 | // clear the cached instance *after* the emulation has happened (since |
|
| 396 | // instances get re-added by the select statement contained therein). |
|
| 397 | TaskTableMap::clearInstancePool(); |
|
| 398 | TaskTableMap::clearRelatedInstancePool(); |
|
| 399 | ||
| 400 | return $affectedRows; |
|
| 401 | }); |
|
| 402 | } |
|
| 403 | ||
| 404 | /** |
|
| 405 | * Performs a DELETE on the database based on the current ModelCriteria |
|
| @@ 519-538 (lines=20) @@ | ||
| 516 | * @param ConnectionInterface $con the connection to use |
|
| 517 | * @return int The number of affected rows (if supported by underlying database driver). |
|
| 518 | */ |
|
| 519 | public function doDeleteAll(ConnectionInterface $con = null) |
|
| 520 | { |
|
| 521 | if (null === $con) { |
|
| 522 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
|
| 523 | } |
|
| 524 | ||
| 525 | // use transaction because $criteria could contain info |
|
| 526 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
|
| 527 | return $con->transaction(function () use ($con) { |
|
| 528 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
| 529 | $affectedRows += parent::doDeleteAll($con); |
|
| 530 | // Because this db requires some delete cascade/set null emulation, we have to |
|
| 531 | // clear the cached instance *after* the emulation has happened (since |
|
| 532 | // instances get re-added by the select statement contained therein). |
|
| 533 | UserTableMap::clearInstancePool(); |
|
| 534 | UserTableMap::clearRelatedInstancePool(); |
|
| 535 | ||
| 536 | return $affectedRows; |
|
| 537 | }); |
|
| 538 | } |
|
| 539 | ||
| 540 | /** |
|
| 541 | * Performs a DELETE on the database based on the current ModelCriteria |
|