Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrothmann1 committed Aug 15, 2017
1 parent 3e3cf7c commit 6c741db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Manipulate/Operations/ManipulationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ public function create($data){
public function update($data){
try{
DB::beginTransaction();
$this->executeBeforeUpdate($data);
$relMeta=$this->reflectRelationships();
$model=$this->getModel($data[$this->reflector->getPrimaryKey()]);
$this->executeBeforeUpdate($data,$model);
$this->transferAttributes($this->definition->getFieldSet(),$model,$data);
$this->transferAllRelationFields($this->definition->getFieldSet(),$model,$data,$relMeta);

Expand Down
4 changes: 2 additions & 2 deletions src/Rocket/Traits/DefinesEventHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public function afterView($function){
return $this;
}

protected function executeBeforeUpdate(&$data){
protected function executeBeforeUpdate(&$data,&$model){
if(array_key_exists('beforeUpdate',$this->hooks)&&is_callable($this->hooks['beforeUpdate'])){
$func=$this->hooks['beforeUpdate'];
$func($data);
$func($data,$model);
}
return $data;
}
Expand Down

0 comments on commit 6c741db

Please sign in to comment.