Code Duplication    Length = 20-20 lines in 3 locations

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

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

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

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

@@ 529-548 (lines=20) @@
526
     * @param ConnectionInterface $con the connection to use
527
     * @return int The number of affected rows (if supported by underlying database driver).
528
     */
529
    public function doDeleteAll(ConnectionInterface $con = null)
530
    {
531
        if (null === $con) {
532
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
533
        }
534
535
        // use transaction because $criteria could contain info
536
        // for more than one table or we could emulating ON DELETE CASCADE, etc.
537
        return $con->transaction(function () use ($con) {
538
            $affectedRows = 0; // initialize var to track total num of affected rows
539
            $affectedRows += parent::doDeleteAll($con);
540
            // Because this db requires some delete cascade/set null emulation, we have to
541
            // clear the cached instance *after* the emulation has happened (since
542
            // instances get re-added by the select statement contained therein).
543
            UserTableMap::clearInstancePool();
544
            UserTableMap::clearRelatedInstancePool();
545
546
            return $affectedRows;
547
        });
548
    }
549
550
    /**
551
     * Performs a DELETE on the database based on the current ModelCriteria