Code Duplication    Length = 9-9 lines in 2 locations

src/Model.php 2 locations

@@ 751-759 (lines=9) @@
748
749
        // build the insert array
750
        $insertValues = [];
751
        foreach ($this->_unsaved as $k => $value) {
752
            // remove any non-existent or immutable properties
753
            $property = static::getProperty($k);
754
            if ($property === null || $property['mutable'] == self::IMMUTABLE) {
755
                continue;
756
            }
757
758
            $insertValues[$k] = $value;
759
        }
760
761
        if (!self::getDriver()->createModel($this, $insertValues)) {
762
            return false;
@@ 837-845 (lines=9) @@
834
835
        // build the update array
836
        $updateValues = [];
837
        foreach ($this->_unsaved as $k => $value) {
838
            // remove any non-existent or immutable properties
839
            $property = static::getProperty($k);
840
            if ($property === null || $property['mutable'] != self::MUTABLE) {
841
                continue;
842
            }
843
844
            $updateValues[$k] = $value;
845
        }
846
847
        if (!self::getDriver()->updateModel($this, $updateValues)) {
848
            return false;