Skip to content

keep Propertienames of Arrayfied StorageObjects #1

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

Closed
SvenDeKa opened this issue Nov 24, 2016 · 2 comments
Closed

keep Propertienames of Arrayfied StorageObjects #1

SvenDeKa opened this issue Nov 24, 2016 · 2 comments

Comments

@SvenDeKa
Copy link

SvenDeKa commented Nov 24, 2016

As you're already extending JsonView for the Configuration, you could also change the behaviour of transformValues() in order to toArray all $values being an instance of StorageObject:

protected function transformValue($value, array $configuration)
    {
        if($value instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage) {
            $value = $value->toArray();
        }
...
rest of the original Function.
}

what do you think?

BTW: thx for the HowTo ;)

@ervaude
Copy link
Owner

ervaude commented Nov 25, 2016

I guess that would be clever! It is highly unlikely that you need the ObjectStorage hashes as object keys in your JSON.
👍

@ervaude
Copy link
Owner

ervaude commented Dec 18, 2016

Thanks for the hint. I also udpated the blog post.

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

No branches or pull requests

2 participants