Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mathsgod committed May 24, 2022
1 parent 840df79 commit e33d561
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ function save()

$key = static::_key();


$hydrator = new ObjectPropertyHydrator();
$source = $hydrator->extract($this);

if ($this->$key) { // update
$mode = "update";
$dispatcher->dispatch(new Event\BeforeUpdate($this));
Expand All @@ -237,6 +233,9 @@ function save()
$dispatcher->dispatch(new Event\BeforeInsert($this));
}

$hydrator = new ObjectPropertyHydrator();
$source = $hydrator->extract($this);

// generate record
$records = [];
$generated = [];
Expand Down

0 comments on commit e33d561

Please sign in to comment.