Code Duplication    Length = 12-15 lines in 2 locations

src/Model.php 2 locations

@@ 785-799 (lines=15) @@
782
783
        $created = self::$driver->createModel($this, $insertArray);
784
785
        if ($created) {
786
            // determine the model's new ID
787
            $this->getNewID();
788
789
            // NOTE clear the local cache before the model.created
790
            // event so that fetching values forces a reload
791
            // from the storage layer
792
            $this->clearCache();
793
            $this->_persisted = true;
794
795
            // dispatch the model.created event
796
            if (!$this->performDispatch(ModelEvent::CREATED)) {
797
                return false;
798
            }
799
        }
800
801
        return $created;
802
    }
@@ 1050-1061 (lines=12) @@
1047
1048
        $updated = self::$driver->updateModel($this, $updateArray);
1049
1050
        if ($updated) {
1051
            // NOTE clear the local cache before the model.updated
1052
            // event so that fetching values forces a reload
1053
            // from the storage layer
1054
            $this->clearCache();
1055
            $this->_persisted = true;
1056
1057
            // dispatch the model.updated event
1058
            if (!$this->performDispatch(ModelEvent::UPDATED)) {
1059
                return false;
1060
            }
1061
        }
1062
1063
        return $updated;
1064
    }