Code Duplication    Length = 21-21 lines in 2 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

@@ 704-724 (lines=21) @@
701
     * @see User::setDeleted()
702
     * @see User::isDeleted()
703
     */
704
    public function delete(ConnectionInterface $con = null)
705
    {
706
        if ($this->isDeleted()) {
707
            throw new PropelException("This object has already been deleted.");
708
        }
709
710
        if ($con === null) {
711
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
712
        }
713
714
        $con->transaction(function () use ($con) {
715
            $deleteQuery = ChildUserQuery::create()
716
                ->filterByPrimaryKey($this->getPrimaryKey());
717
            $ret = $this->preDelete($con);
718
            if ($ret) {
719
                $deleteQuery->delete($con);
720
                $this->postDelete($con);
721
                $this->setDeleted(true);
722
            }
723
        });
724
    }
725
726
    /**
727
     * Persists this object to the database.