Code Duplication    Length = 30-33 lines in 5 locations

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

@@ 625-657 (lines=33) @@
622
     * @return void
623
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
624
     */
625
    public function reload($deep = false, ConnectionInterface $con = null)
626
    {
627
        if ($this->isDeleted()) {
628
            throw new PropelException("Cannot reload a deleted object.");
629
        }
630
631
        if ($this->isNew()) {
632
            throw new PropelException("Cannot reload an unsaved object.");
633
        }
634
635
        if ($con === null) {
636
            $con = Propel::getServiceContainer()->getReadConnection(RouteTableMap::DATABASE_NAME);
637
        }
638
639
        // We don't need to alter the object instance pool; we're just modifying this instance
640
        // already in the pool.
641
642
        $dataFetcher = ChildRouteQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
643
        $row = $dataFetcher->fetch();
644
        $dataFetcher->close();
645
        if (!$row) {
646
            throw new PropelException('Cannot find matching row in the database to reload object values.');
647
        }
648
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
649
650
        if ($deep) {  // also de-associate any related objects?
651
652
            $this->collSCategories = null;
653
654
            $this->collSProductss = null;
655
656
        } // if (deep)
657
    }
658
659
    /**
660
     * Removes this object from datastore and sets delete attribute.

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

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

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

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

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

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

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

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