Code Duplication    Length = 23-23 lines in 3 locations

packages/core/src/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.

packages/core/src/Models/User/Base/User.php 1 location

@@ 812-834 (lines=23) @@
809
     * @throws PropelException
810
     * @see save()
811
     */
812
    protected function doSave(ConnectionInterface $con)
813
    {
814
        $affectedRows = 0; // initialize var to track total num of affected rows
815
        if (!$this->alreadyInSave) {
816
            $this->alreadyInSave = true;
817
818
            if ($this->isNew() || $this->isModified()) {
819
                // persist changes
820
                if ($this->isNew()) {
821
                    $this->doInsert($con);
822
                    $affectedRows += 1;
823
                } else {
824
                    $affectedRows += $this->doUpdate($con);
825
                }
826
                $this->resetModified();
827
            }
828
829
            $this->alreadyInSave = false;
830
831
        }
832
833
        return $affectedRows;
834
    } // doSave()
835
836
    /**
837
     * Insert the row in the database.

packages/selfprice/src/Models/Selfprice/Base/Selfprice.php 1 location

@@ 655-677 (lines=23) @@
652
     * @throws PropelException
653
     * @see save()
654
     */
655
    protected function doSave(ConnectionInterface $con)
656
    {
657
        $affectedRows = 0; // initialize var to track total num of affected rows
658
        if (!$this->alreadyInSave) {
659
            $this->alreadyInSave = true;
660
661
            if ($this->isNew() || $this->isModified()) {
662
                // persist changes
663
                if ($this->isNew()) {
664
                    $this->doInsert($con);
665
                    $affectedRows += 1;
666
                } else {
667
                    $affectedRows += $this->doUpdate($con);
668
                }
669
                $this->resetModified();
670
            }
671
672
            $this->alreadyInSave = false;
673
674
        }
675
676
        return $affectedRows;
677
    } // doSave()
678
679
    /**
680
     * Insert the row in the database.