Skip to content

Commit 39f0326

Browse files
authored
Merge pull request #107 from as3io/zarathustra323-patch-1
Rely on model's `isDirty()` over `getState()`
2 parents ab7c1a6 + b294d2e commit 39f0326

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Store/Store.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ public function commit(Model $model)
503503
// Deletes must execute before updates to prevent an update then a delete.
504504
$this->doCommitDelete($model);
505505

506-
} elseif (true === $model->getState()->is('dirty')) {
506+
} elseif (true === $model->isDirty()) {
507507
$this->doCommitUpdate($model);
508508

509509
} else {
@@ -628,7 +628,7 @@ public function convertAttributeValue($dataType, $value)
628628
protected function shouldCommit(Model $model)
629629
{
630630
$state = $model->getState();
631-
return true === $state->is('dirty') || $state->is('new') || $state->is('deleting');
631+
return $model->isDirty() || $state->is('new') || $state->is('deleting');
632632
}
633633

634634
/**

0 commit comments

Comments
 (0)