Skip to content

Commit 6543565

Browse files
committed
convert entity to id
1 parent 9bb3a40 commit 6543565

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Repository.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public function create($data)
3737
foreach($this->space->getFormat() as $row) {
3838
if(array_key_exists($row['name'], $data)) {
3939
$instance->{$row['name']} = $data[$row['name']];
40+
if($data[$row['name']] instanceof Entity) {
41+
$instance->{$row['name']} = $instance->{$row['name']}->id;
42+
}
4043
}
4144
}
4245

0 commit comments

Comments
 (0)