Compare commits
2 Commits
18313fd7f5
...
2fda7e82d7
Author | SHA1 | Date | |
---|---|---|---|
|
2fda7e82d7 | ||
|
573d4cc06b |
@ -109,7 +109,13 @@ class RelationBuilder
|
||||
|
||||
$this->entity->eventExecute(Event\EntityRelationLoadInterface::class, $name, $this->repository);
|
||||
|
||||
return call_user_func([ $this->repository, $relation->function() ]) ?? $this->instanciateEmptyEntity($name, $relation);
|
||||
$value = call_user_func([ $this->repository, $relation->function() ]) ?? null;
|
||||
|
||||
if ($value === null && $this->resolver->reflectedClass->getProperties(true)[$name]->allowsNull()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $value ?? $this->instanciateEmptyEntity($name, $relation);
|
||||
|
||||
case $relation->isOneToMany():
|
||||
$this->oneToMany($name, $relation);
|
||||
|
Loading…
x
Reference in New Issue
Block a user