Code Duplication    Length = 12-15 lines in 2 locations

src/Model.php 2 locations

@@ 803-817 (lines=15) @@
800
801
        $created = self::$driver->createModel($this, $insertArray);
802
803
        if ($created) {
804
            // determine the model's new ID
805
            $this->getNewID();
806
807
            // NOTE clear the local cache before the model.created
808
            // event so that fetching values forces a reload
809
            // from the storage layer
810
            $this->clearCache();
811
            $this->_persisted = true;
812
813
            // dispatch the model.created event
814
            if (!$this->handleDispatch(ModelEvent::CREATED)) {
815
                return false;
816
            }
817
        }
818
819
        return $created;
820
    }
@@ 1040-1051 (lines=12) @@
1037
1038
        $updated = self::$driver->updateModel($this, $updateArray);
1039
1040
        if ($updated) {
1041
            // NOTE clear the local cache before the model.updated
1042
            // event so that fetching values forces a reload
1043
            // from the storage layer
1044
            $this->clearCache();
1045
            $this->_persisted = true;
1046
1047
            // dispatch the model.updated event
1048
            if (!$this->handleDispatch(ModelEvent::UPDATED)) {
1049
                return false;
1050
            }
1051
        }
1052
1053
        return $updated;
1054
    }