Code Duplication    Length = 29-29 lines in 2 locations

app/Models/Task/Base/Task.php 1 location

@@ 509-537 (lines=29) @@
506
     * @return void
507
     * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
508
     */
509
    public function reload($deep = false, ConnectionInterface $con = null)
510
    {
511
        if ($this->isDeleted()) {
512
            throw new PropelException("Cannot reload a deleted object.");
513
        }
514
515
        if ($this->isNew()) {
516
            throw new PropelException("Cannot reload an unsaved object.");
517
        }
518
519
        if ($con === null) {
520
            $con = Propel::getServiceContainer()->getReadConnection(TaskTableMap::DATABASE_NAME);
521
        }
522
523
        // We don't need to alter the object instance pool; we're just modifying this instance
524
        // already in the pool.
525
526
        $dataFetcher = ChildTaskQuery::create(null, $this->buildPkeyCriteria())->setFormatter(ModelCriteria::FORMAT_STATEMENT)->find($con);
527
        $row = $dataFetcher->fetch();
528
        $dataFetcher->close();
529
        if (!$row) {
530
            throw new PropelException('Cannot find matching row in the database to reload object values.');
531
        }
532
        $this->hydrate($row, 0, true, $dataFetcher->getIndexType()); // rehydrate
533
534
        if ($deep) {  // also de-associate any related objects?
535
536
        } // if (deep)
537
    }
538
539
    /**
540
     * Removes this object from datastore and sets delete attribute.

app/Models/User/Base/User.php 1 location

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