neo4j-php-ogm
neo4j-php-ogm copied to clipboard
RelationshipMetadata returns wrong FQCN when entity is extended in a different namespace
Say I have an entity Foo
with a relationship bar
:
namespace App\Entity;
/**
* @OGM\Node(label="Foo")
*/
class Foo
{
/**
* @OGM\Relationship(type="RELATED_TO", direction="OUTGOING", targetEntity="Bar", collection=false)
* @var Bar
*/
protected $bar;
}
Then I have a class FooBar extend Foo, but in a different namespace:
namespace App\Entity\FooBar;
use App\Entity\Foo;
/**
* @OGM\Node(label="FooBar")
*/
class FooBar extends Foo
{
}
When RelationshipMetadata
resolves the FQCN for the Bar
relationship from the FooBar
entity, it returns App\Entity\FooBar\Bar
rather than App\Entity\Bar
.
I haven't looked into it very deeply, so I'm not sure if it's easy to fix or if it should just be documented somewhere.
Thanks, currently inheritance is not supported. So I leave it open for now, I didn't looked deeply into that yet tbh.