Code Duplication    Length = 21-21 lines in 3 locations

app/Models/Task/Base/Task.php 1 location

@@ 548-568 (lines=21) @@
545
     * @see Task::setDeleted()
546
     * @see Task::isDeleted()
547
     */
548
    public function delete(ConnectionInterface $con = null)
549
    {
550
        if ($this->isDeleted()) {
551
            throw new PropelException("This object has already been deleted.");
552
        }
553
554
        if ($con === null) {
555
            $con = Propel::getServiceContainer()->getWriteConnection(TaskTableMap::DATABASE_NAME);
556
        }
557
558
        $con->transaction(function () use ($con) {
559
            $deleteQuery = ChildTaskQuery::create()
560
                ->filterByPrimaryKey($this->getPrimaryKey());
561
            $ret = $this->preDelete($con);
562
            if ($ret) {
563
                $deleteQuery->delete($con);
564
                $this->postDelete($con);
565
                $this->setDeleted(true);
566
            }
567
        });
568
    }
569
570
    /**
571
     * Persists this object to the database.

app/Models/User/Base/User.php 1 location

@@ 731-751 (lines=21) @@
728
     * @see User::setDeleted()
729
     * @see User::isDeleted()
730
     */
731
    public function delete(ConnectionInterface $con = null)
732
    {
733
        if ($this->isDeleted()) {
734
            throw new PropelException("This object has already been deleted.");
735
        }
736
737
        if ($con === null) {
738
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
739
        }
740
741
        $con->transaction(function () use ($con) {
742
            $deleteQuery = ChildUserQuery::create()
743
                ->filterByPrimaryKey($this->getPrimaryKey());
744
            $ret = $this->preDelete($con);
745
            if ($ret) {
746
                $deleteQuery->delete($con);
747
                $this->postDelete($con);
748
                $this->setDeleted(true);
749
            }
750
        });
751
    }
752
753
    /**
754
     * Persists this object to the database.

app/Price/Models/Selfprice/Base/Selfprice.php 1 location

@@ 574-594 (lines=21) @@
571
     * @see Selfprice::setDeleted()
572
     * @see Selfprice::isDeleted()
573
     */
574
    public function delete(ConnectionInterface $con = null)
575
    {
576
        if ($this->isDeleted()) {
577
            throw new PropelException("This object has already been deleted.");
578
        }
579
580
        if ($con === null) {
581
            $con = Propel::getServiceContainer()->getWriteConnection(SelfpriceTableMap::DATABASE_NAME);
582
        }
583
584
        $con->transaction(function () use ($con) {
585
            $deleteQuery = ChildSelfpriceQuery::create()
586
                ->filterByPrimaryKey($this->getPrimaryKey());
587
            $ret = $this->preDelete($con);
588
            if ($ret) {
589
                $deleteQuery->delete($con);
590
                $this->postDelete($con);
591
                $this->setDeleted(true);
592
            }
593
        });
594
    }
595
596
    /**
597
     * Persists this object to the database.