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 agree, this seems inconsistent. At one point identifier_name it is representing a route id and later an object id. It took me some time to figure this out. Another solution would be to let the identifier_name in the meta data map represent the route identifier (like done in the resource definitions) and use the getIdFromResource function defined at line 865 to get the identifier out of the object like done similarly on line 581: $id = $this->getIdFromResource($resource);
+1 i've run up against this issue also. The name of the identifier key on the resource won't necessarily be the same as the identifier key on the route.
According to the documentation here https://phlyrestfully.readthedocs.org/en/latest/ref/advanced-routing.html one should use a metadata_map instead of using listeners.
But according to this line: https://github.com/phly/PhlyRestfully/blob/master/src/PhlyRestfully/Plugin/HalLinks.php#L558
It's extracted from the metadata
identifier_name
that represents the identifier for the object and not the route.thus the metadata_map can currently not solve the child routes properly.
My suggestion would be to add another parameter to the metadata mapping
route_identifier_name
and if it's not set assume the same asidentifier_name
Suggestions on a fix @weierophinney ?
The text was updated successfully, but these errors were encountered: