Skip to content

Commit

Permalink
#313 Handling of link models
Browse files Browse the repository at this point in the history
  • Loading branch information
j3nsch committed Sep 2, 2022
1 parent 4978289 commit 50ec636
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Opus/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,15 @@ public function updateFromArray($data)
if ($linkModelClass !== null) {
$linkModel = new $linkModelClass();
$linkModel->setModel($model);
$newModel = $model->isNewRecord();
$model = $linkModel;
if ($newModel) {
// only populate model if it is new
// TODO allow update of dependent models like licences?
$model->updateFromArray($modelValues);
}
}

// $model->updateFromArray($modelValues);
$models[] = $model;
}

Expand Down

0 comments on commit 50ec636

Please sign in to comment.