You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand how to use the annotation @RelationProvider. The current object is never available on all methods (exp(), object::static() or func() )
How to get the current object to iterate on elements from his method ?
example :
namespace App\Entity;
/*
* @Hateoas\Relation( ??? ... object.getOtherObjects() ... ??? )
*/
class MyObject
{
/**
* @ORM\ManyToMany(targetEntity=MyOtherObject::class, inversedBy="myObjects")
*/
private $otherObject;
...
public function getOtherObjects()
{
return $this->otherObject;
}
...
}
class MyObject
{
...
public function getId()
{
return $this->id;
}
...
}
I've got the exact same question. As far as I understand the RelationProvider construct, it's not meant to provide Relations in realtime, but provide a single place where you can provide parsed Relation (expressions) which then can be cached.
I did not read the code to the end, but I guess all a RelationProvider does is providing a collection of cachable Relation metadata from one place.
However I think you use case should be adressed with @Embedded.
Hello,
I don't understand how to use the annotation @RelationProvider. The current object is never available on all methods (exp(), object::static() or func() )
How to get the current object to iterate on elements from his method ?
example :
To generate ...
thank's you
The text was updated successfully, but these errors were encountered: