neo4j-php-ogm icon indicating copy to clipboard operation
neo4j-php-ogm copied to clipboard

RelationshipMetadata returns wrong FQCN when entity is extended in a different namespace

Open AndrolGenhald opened this issue 8 years ago • 1 comments

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.

AndrolGenhald avatar Jul 31 '16 22:07 AndrolGenhald

Thanks, currently inheritance is not supported. So I leave it open for now, I didn't looked deeply into that yet tbh.

ikwattro avatar Jul 31 '16 23:07 ikwattro