| @@ 880-891 (lines=12) @@ | ||
| 877 | ||
| 878 | $updated = self::getDriver()->updateModel($this, $updateArray); |
|
| 879 | ||
| 880 | if ($updated) { |
|
| 881 | // NOTE clear the local cache before the model.updated |
|
| 882 | // event so that fetching values forces a reload |
|
| 883 | // from the data layer |
|
| 884 | $this->clearCache(); |
|
| 885 | ||
| 886 | // dispatch the model.updated event |
|
| 887 | $event = $this->dispatch(ModelEvent::UPDATED); |
|
| 888 | if ($event->isPropagationStopped()) { |
|
| 889 | return false; |
|
| 890 | } |
|
| 891 | } |
|
| 892 | ||
| 893 | return $updated; |
|
| 894 | } |
|
| @@ 915-926 (lines=12) @@ | ||
| 912 | ||
| 913 | $deleted = self::getDriver()->deleteModel($this); |
|
| 914 | ||
| 915 | if ($deleted) { |
|
| 916 | // dispatch the model.deleted event |
|
| 917 | $event = $this->dispatch(ModelEvent::DELETED); |
|
| 918 | if ($event->isPropagationStopped()) { |
|
| 919 | return false; |
|
| 920 | } |
|
| 921 | ||
| 922 | // NOTE clear the local cache before the model.deleted |
|
| 923 | // event so that fetching values forces a reload |
|
| 924 | // from the data layer |
|
| 925 | $this->clearCache(); |
|
| 926 | } |
|
| 927 | ||
| 928 | return $deleted; |
|
| 929 | } |
|