Code Duplication    Length = 21-21 lines in 6 locations

src/cli/Database/Base/Channel.php 1 location

@@ 565-585 (lines=21) @@
562
     * @see Channel::setDeleted()
563
     * @see Channel::isDeleted()
564
     */
565
    public function delete(ConnectionInterface $con = null)
566
    {
567
        if ($this->isDeleted()) {
568
            throw new PropelException("This object has already been deleted.");
569
        }
570
571
        if ($con === null) {
572
            $con = Propel::getServiceContainer()->getWriteConnection(ChannelTableMap::DATABASE_NAME);
573
        }
574
575
        $con->transaction(function () use ($con) {
576
            $deleteQuery = ChildChannelQuery::create()
577
                ->filterByPrimaryKey($this->getPrimaryKey());
578
            $ret = $this->preDelete($con);
579
            if ($ret) {
580
                $deleteQuery->delete($con);
581
                $this->postDelete($con);
582
                $this->setDeleted(true);
583
            }
584
        });
585
    }
586
587
    /**
588
     * Persists this object to the database.

src/cli/Database/Base/Connection.php 1 location

@@ 693-713 (lines=21) @@
690
     * @see Connection::setDeleted()
691
     * @see Connection::isDeleted()
692
     */
693
    public function delete(ConnectionInterface $con = null)
694
    {
695
        if ($this->isDeleted()) {
696
            throw new PropelException("This object has already been deleted.");
697
        }
698
699
        if ($con === null) {
700
            $con = Propel::getServiceContainer()->getWriteConnection(ConnectionTableMap::DATABASE_NAME);
701
        }
702
703
        $con->transaction(function () use ($con) {
704
            $deleteQuery = ChildConnectionQuery::create()
705
                ->filterByPrimaryKey($this->getPrimaryKey());
706
            $ret = $this->preDelete($con);
707
            if ($ret) {
708
                $deleteQuery->delete($con);
709
                $this->postDelete($con);
710
                $this->setDeleted(true);
711
            }
712
        });
713
    }
714
715
    /**
716
     * Persists this object to the database.

src/cli/Database/Base/User.php 1 location

@@ 582-602 (lines=21) @@
579
     * @see User::setDeleted()
580
     * @see User::isDeleted()
581
     */
582
    public function delete(ConnectionInterface $con = null)
583
    {
584
        if ($this->isDeleted()) {
585
            throw new PropelException("This object has already been deleted.");
586
        }
587
588
        if ($con === null) {
589
            $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME);
590
        }
591
592
        $con->transaction(function () use ($con) {
593
            $deleteQuery = ChildUserQuery::create()
594
                ->filterByPrimaryKey($this->getPrimaryKey());
595
            $ret = $this->preDelete($con);
596
            if ($ret) {
597
                $deleteQuery->delete($con);
598
                $this->postDelete($con);
599
                $this->setDeleted(true);
600
            }
601
        });
602
    }
603
604
    /**
605
     * Persists this object to the database.

src/cli/Database/Base/Input.php 1 location

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

src/cli/Database/Base/Instance.php 1 location

@@ 538-558 (lines=21) @@
535
     * @see Instance::setDeleted()
536
     * @see Instance::isDeleted()
537
     */
538
    public function delete(ConnectionInterface $con = null)
539
    {
540
        if ($this->isDeleted()) {
541
            throw new PropelException("This object has already been deleted.");
542
        }
543
544
        if ($con === null) {
545
            $con = Propel::getServiceContainer()->getWriteConnection(InstanceTableMap::DATABASE_NAME);
546
        }
547
548
        $con->transaction(function () use ($con) {
549
            $deleteQuery = ChildInstanceQuery::create()
550
                ->filterByPrimaryKey($this->getPrimaryKey());
551
            $ret = $this->preDelete($con);
552
            if ($ret) {
553
                $deleteQuery->delete($con);
554
                $this->postDelete($con);
555
                $this->setDeleted(true);
556
            }
557
        });
558
    }
559
560
    /**
561
     * Persists this object to the database.

src/cli/Database/Base/Subscription.php 1 location

@@ 893-913 (lines=21) @@
890
     * @see Subscription::setDeleted()
891
     * @see Subscription::isDeleted()
892
     */
893
    public function delete(ConnectionInterface $con = null)
894
    {
895
        if ($this->isDeleted()) {
896
            throw new PropelException("This object has already been deleted.");
897
        }
898
899
        if ($con === null) {
900
            $con = Propel::getServiceContainer()->getWriteConnection(SubscriptionTableMap::DATABASE_NAME);
901
        }
902
903
        $con->transaction(function () use ($con) {
904
            $deleteQuery = ChildSubscriptionQuery::create()
905
                ->filterByPrimaryKey($this->getPrimaryKey());
906
            $ret = $this->preDelete($con);
907
            if ($ret) {
908
                $deleteQuery->delete($con);
909
                $this->postDelete($con);
910
                $this->setDeleted(true);
911
            }
912
        });
913
    }
914
915
    /**
916
     * Persists this object to the database.