Commit d01b37ef authored by Guillaume Perréal's avatar Guillaume Perréal

Supporte l'inclusion des classes non-ressources.

parent 8b243974
......@@ -119,13 +119,18 @@ class PropertyMetadataFactory
}
$leafClassName = $leafType->getClassName();
if (!$leafClassName || !$this->resourceClassResolver->isResourceClass($leafClassName)) {
if (!$leafClassName || !class_exists($leafClassName)) {
return [false, false];
}
$embedded = $this->mode === self::MODE_READ ? $propertyMeta->isReadableLink() : $propertyMeta->isWritableLink();
if ($this->resourceClassResolver->isResourceClass($leafClassName)) {
$embedded = $this->mode === self::MODE_READ ? $propertyMeta->isReadableLink() : $propertyMeta->isWritableLink();
return [true, (bool) $embedded];
return [true, (bool) $embedded];
}
$reflection = new \ReflectionClass($leafClassName);
return [false, $reflection->isUserDefined()];
}
private function getLeafType(Type $type): ?Type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment