Code Duplication    Length = 13-16 lines in 2 locations

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

@@ 690-702 (lines=13) @@
687
688
        try {
689
            $stmt = $con->prepare($sql);
690
            foreach ($modifiedColumns as $identifier => $columnName) {
691
                switch ($columnName) {
692
                    case 'id':
693
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
694
                        break;
695
                    case 'created_at':
696
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
697
                        break;
698
                    case 'updated_at':
699
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
700
                        break;
701
                }
702
            }
703
            $stmt->execute();
704
        } catch (Exception $e) {
705
            Propel::log($e->getMessage(), Propel::LOG_ERR);

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

@@ 719-734 (lines=16) @@
716
717
        try {
718
            $stmt = $con->prepare($sql);
719
            foreach ($modifiedColumns as $identifier => $columnName) {
720
                switch ($columnName) {
721
                    case 'id':
722
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
723
                        break;
724
                    case 'name':
725
                        $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
726
                        break;
727
                    case 'datecreate':
728
                        $stmt->bindValue($identifier, $this->datecreate ? $this->datecreate->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
729
                        break;
730
                    case 'desc':
731
                        $stmt->bindValue($identifier, $this->desc, PDO::PARAM_STR);
732
                        break;
733
                }
734
            }
735
            $stmt->execute();
736
        } catch (Exception $e) {
737
            Propel::log($e->getMessage(), Propel::LOG_ERR);