Code Duplication    Length = 30-33 lines in 4 locations

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

@@ 817-848 (lines=32) @@
814
     * @return void
815
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
816
     */
817
    public function reload($deep = false, ConnectionInterface $con = null)
818
    {
819
        if ($this->isDeleted()) {
820
            throw new PropelException("Cannot reload a deleted object.");
821
        }
822
823
        if ($this->isNew()) {
824
            throw new PropelException("Cannot reload an unsaved object.");
825
        }
826
827
        if ($con === null) {
828
            $con = Propel::getServiceContainer()->getReadConnection(BannerImageTableMap::DATABASE_NAME);
829
        }
830
831
        // We don't need to alter the object instance pool; we're just modifying this instance
832
        // already in the pool.
833
834
        $dataFetcher = ChildBannerImageQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
835
        $row = $dataFetcher->fetch();
836
        $dataFetcher->close();
837
        if (!$row) {
838
            throw new PropelException('Cannot find matching row in the database to reload object values.');
839
        }
840
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
841
842
        if ($deep) {  // also de-associate any related objects?
843
844
            $this->aBanners = null;
845
            $this->collBannerImageI18ns = null;
846
847
        } // if (deep)
848
    }
849
850
    /**
851
     * Removes this object from datastore and sets delete attribute.

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

@@ 644-673 (lines=30) @@
641
     * @return void
642
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
643
     */
644
    public function reload($deep = false, ConnectionInterface $con = null)
645
    {
646
        if ($this->isDeleted()) {
647
            throw new PropelException("Cannot reload a deleted object.");
648
        }
649
650
        if ($this->isNew()) {
651
            throw new PropelException("Cannot reload an unsaved object.");
652
        }
653
654
        if ($con === null) {
655
            $con = Propel::getServiceContainer()->getReadConnection(BannerImageI18nTableMap::DATABASE_NAME);
656
        }
657
658
        // We don't need to alter the object instance pool; we're just modifying this instance
659
        // already in the pool.
660
661
        $dataFetcher = ChildBannerImageI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
662
        $row = $dataFetcher->fetch();
663
        $dataFetcher->close();
664
        if (!$row) {
665
            throw new PropelException('Cannot find matching row in the database to reload object values.');
666
        }
667
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
668
669
        if ($deep) {  // also de-associate any related objects?
670
671
            $this->aBannerImage = null;
672
        } // if (deep)
673
    }
674
675
    /**
676
     * Removes this object from datastore and sets delete attribute.

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

@@ 658-690 (lines=33) @@
655
     * @return void
656
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
657
     */
658
    public function reload($deep = false, ConnectionInterface $con = null)
659
    {
660
        if ($this->isDeleted()) {
661
            throw new PropelException("Cannot reload a deleted object.");
662
        }
663
664
        if ($this->isNew()) {
665
            throw new PropelException("Cannot reload an unsaved object.");
666
        }
667
668
        if ($con === null) {
669
            $con = Propel::getServiceContainer()->getReadConnection(BannersTableMap::DATABASE_NAME);
670
        }
671
672
        // We don't need to alter the object instance pool; we're just modifying this instance
673
        // already in the pool.
674
675
        $dataFetcher = ChildBannersQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
676
        $row = $dataFetcher->fetch();
677
        $dataFetcher->close();
678
        if (!$row) {
679
            throw new PropelException('Cannot find matching row in the database to reload object values.');
680
        }
681
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
682
683
        if ($deep) {  // also de-associate any related objects?
684
685
            $this->collBannerImages = null;
686
687
            $this->collBannersI18ns = null;
688
689
        } // if (deep)
690
    }
691
692
    /**
693
     * Removes this object from datastore and sets delete attribute.

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

@@ 524-553 (lines=30) @@
521
     * @return void
522
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
523
     */
524
    public function reload($deep = false, ConnectionInterface $con = null)
525
    {
526
        if ($this->isDeleted()) {
527
            throw new PropelException("Cannot reload a deleted object.");
528
        }
529
530
        if ($this->isNew()) {
531
            throw new PropelException("Cannot reload an unsaved object.");
532
        }
533
534
        if ($con === null) {
535
            $con = Propel::getServiceContainer()->getReadConnection(BannersI18nTableMap::DATABASE_NAME);
536
        }
537
538
        // We don't need to alter the object instance pool; we're just modifying this instance
539
        // already in the pool.
540
541
        $dataFetcher = ChildBannersI18nQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
542
        $row = $dataFetcher->fetch();
543
        $dataFetcher->close();
544
        if (!$row) {
545
            throw new PropelException('Cannot find matching row in the database to reload object values.');
546
        }
547
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
548
549
        if ($deep) {  // also de-associate any related objects?
550
551
            $this->aBanners = null;
552
        } // if (deep)
553
    }
554
555
    /**
556
     * Removes this object from datastore and sets delete attribute.