Code Duplication    Length = 21-21 lines in 5 locations

application/modules/xbanners/models/Base/BannerImage.php 1 location

@@ 860-880 (lines=21) @@
857
     * @see BannerImage::setDeleted()
858
     * @see BannerImage::isDeleted()
859
     */
860
    public function delete(ConnectionInterface $con = null)
861
    {
862
        if ($this->isDeleted()) {
863
            throw new PropelException("This object has already been deleted.");
864
        }
865
866
        if ($con === null) {
867
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageTableMap::DATABASE_NAME);
868
        }
869
870
        $con->transaction(function () use ($con) {
871
            $deleteQuery = ChildBannerImageQuery::create()
872
                ->filterByPrimaryKey($this->getPrimaryKey());
873
            $ret = $this->preDelete($con);
874
            if ($ret) {
875
                $deleteQuery->delete($con);
876
                $this->postDelete($con);
877
                $this->setDeleted(true);
878
            }
879
        });
880
    }
881
882
    /**
883
     * Persists this object to the database.

application/modules/xbanners/models/Base/BannerImageI18n.php 1 location

@@ 685-705 (lines=21) @@
682
     * @see BannerImageI18n::setDeleted()
683
     * @see BannerImageI18n::isDeleted()
684
     */
685
    public function delete(ConnectionInterface $con = null)
686
    {
687
        if ($this->isDeleted()) {
688
            throw new PropelException("This object has already been deleted.");
689
        }
690
691
        if ($con === null) {
692
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
693
        }
694
695
        $con->transaction(function () use ($con) {
696
            $deleteQuery = ChildBannerImageI18nQuery::create()
697
                ->filterByPrimaryKey($this->getPrimaryKey());
698
            $ret = $this->preDelete($con);
699
            if ($ret) {
700
                $deleteQuery->delete($con);
701
                $this->postDelete($con);
702
                $this->setDeleted(true);
703
            }
704
        });
705
    }
706
707
    /**
708
     * Persists this object to the database.

application/modules/xbanners/models/Base/Banners.php 1 location

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

application/modules/xbanners/models/Base/BannersI18n.php 1 location

@@ 565-585 (lines=21) @@
562
     * @see BannersI18n::setDeleted()
563
     * @see BannersI18n::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(BannersI18nTableMap::DATABASE_NAME);
573
        }
574
575
        $con->transaction(function () use ($con) {
576
            $deleteQuery = ChildBannersI18nQuery::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.

application/modules/core/models/Base/Route.php 1 location

@@ 668-688 (lines=21) @@
665
     * @see Route::setDeleted()
666
     * @see Route::isDeleted()
667
     */
668
    public function delete(ConnectionInterface $con = null)
669
    {
670
        if ($this->isDeleted()) {
671
            throw new PropelException("This object has already been deleted.");
672
        }
673
674
        if ($con === null) {
675
            $con = Propel::getServiceContainer()->getWriteConnection(RouteTableMap::DATABASE_NAME);
676
        }
677
678
        $con->transaction(function () use ($con) {
679
            $deleteQuery = ChildRouteQuery::create()
680
                ->filterByPrimaryKey($this->getPrimaryKey());
681
            $ret = $this->preDelete($con);
682
            if ($ret) {
683
                $deleteQuery->delete($con);
684
                $this->postDelete($con);
685
                $this->setDeleted(true);
686
            }
687
        });
688
    }
689
690
    /**
691
     * Persists this object to the database.