Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 629-651 (lines=23) @@
626
     * @throws PropelException
627
     * @see save()
628
     */
629
    protected function doSave(ConnectionInterface $con)
630
    {
631
        $affectedRows = 0; // initialize var to track total num of affected rows
632
        if (!$this->alreadyInSave) {
633
            $this->alreadyInSave = true;
634
635
            if ($this->isNew() || $this->isModified()) {
636
                // persist changes
637
                if ($this->isNew()) {
638
                    $this->doInsert($con);
639
                    $affectedRows += 1;
640
                } else {
641
                    $affectedRows += $this->doUpdate($con);
642
                }
643
                $this->resetModified();
644
            }
645
646
            $this->alreadyInSave = false;
647
648
        }
649
650
        return $affectedRows;
651
    } // doSave()
652
653
    /**
654
     * Insert the row in the database.

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

@@ 785-807 (lines=23) @@
782
     * @throws PropelException
783
     * @see save()
784
     */
785
    protected function doSave(ConnectionInterface $con)
786
    {
787
        $affectedRows = 0; // initialize var to track total num of affected rows
788
        if (!$this->alreadyInSave) {
789
            $this->alreadyInSave = true;
790
791
            if ($this->isNew() || $this->isModified()) {
792
                // persist changes
793
                if ($this->isNew()) {
794
                    $this->doInsert($con);
795
                    $affectedRows += 1;
796
                } else {
797
                    $affectedRows += $this->doUpdate($con);
798
                }
799
                $this->resetModified();
800
            }
801
802
            $this->alreadyInSave = false;
803
804
        }
805
806
        return $affectedRows;
807
    } // doSave()
808
809
    /**
810
     * Insert the row in the database.