There's no way to get the resourceName value, from the Transformer object! It will be useful if you want to use that from the DataArray or Array Serializers as it's used by the JsonApi Serializer.
I'm passing the fractal instance to my parent transformer, which has a function that returns the resource name as follow:
public function getResourceKey()
{
return $this->getFractalInstance()->getResourceName();
}
There's no way to get the
resourceName
value, from the Transformer object! It will be useful if you want to use that from the DataArray or Array Serializers as it's used by the JsonApi Serializer.I'm passing the fractal instance to my parent transformer, which has a function that returns the resource name as follow: