Code Duplication    Length = 20-20 lines in 3 locations

packages/core/src/Models/Task/Base/TaskQuery.php 1 location

@@ 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

packages/core/src/Models/User/Base/UserQuery.php 1 location

@@ 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

packages/selfprice/src/Models/Selfprice/Base/SelfpriceQuery.php 1 location

@@ 403-422 (lines=20) @@
400
     * @param ConnectionInterface $con the connection to use
401
     * @return int The number of affected rows (if supported by underlying database driver).
402
     */
403
    public function doDeleteAll(ConnectionInterface $con = null)
404
    {
405
        if (null === $con) {
406
            $con = Propel::getServiceContainer()->getWriteConnection(SelfpriceTableMap::DATABASE_NAME);
407
        }
408
409
        // use transaction because $criteria could contain info
410
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
411
        return $con->transaction(function () use ($con) {
412
            $affectedRows = 0; // initialize var to track total num of affected rows
413
            $affectedRows += parent::doDeleteAll($con);
414
            // Because this db requires some delete cascade/set null emulation, we have to
415
            // clear the cached instance *after* the emulation has happened (since
416
            // instances get re-added by the select statement contained therein).
417
            SelfpriceTableMap::clearInstancePool();
418
            SelfpriceTableMap::clearRelatedInstancePool();
419
420
            return $affectedRows;
421
        });
422
    }
423
424
    /**
425
     * Performs a DELETE on the database based on the current ModelCriteria