diff --git a/src/MapperRelationships.php b/src/MapperRelationships.php index 0ed8efb..3831fe4 100644 --- a/src/MapperRelationships.php +++ b/src/MapperRelationships.php @@ -241,14 +241,8 @@ public function newRelated(array $fields = []) : Related $this->prototypeRelated = new Related($this->fields); } - $values = []; - $fields = array_intersect_key($fields, $this->fields); - foreach ($fields as $field => $value) { - $values[$field] = $value; - } - $newRelated = clone $this->prototypeRelated; - $newRelated->set($values); + $newRelated->set($fields); return $newRelated; }