Skip to content
Snippets Groups Projects
Commit 555e1626 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #4233

Closes #4233

Merge request studip/studip!3066
parent 4b2395cc
No related branches found
No related tags found
No related merge requests found
Pipeline #24065 passed
...@@ -1555,6 +1555,13 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate ...@@ -1555,6 +1555,13 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate
} }
$this->setValue($options['foreign_key'], $assoc_foreign_key_value); $this->setValue($options['foreign_key'], $assoc_foreign_key_value);
} }
} elseif (
$value === null
&& $this->db_fields()[$options['foreign_key']]['null'] === 'YES'
) {
$this->resetRelation($field);
$this->setValue($options['foreign_key'], null);
} else { } else {
throw new InvalidArgumentException(sprintf('relation %s expects object of type: %s', $field, $options['class_name'])); throw new InvalidArgumentException(sprintf('relation %s expects object of type: %s', $field, $options['class_name']));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment