Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public function to return resourceName #32

Merged
merged 1 commit into from
Sep 8, 2017
Merged

Add public function to return resourceName #32

merged 1 commit into from
Sep 8, 2017

Conversation

Mahmoudz
Copy link
Contributor

@Mahmoudz Mahmoudz commented Sep 7, 2017

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();
    }

@freekmurze freekmurze merged commit d54686c into spatie:master Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants