We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We can set groups on the context as defined here: https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Context.php#L168
But theres no simple method for fetching them.
This usually results in me having to do the following code in every listener...
$attributes = $event->getContext()->attributes; if (!$attributes->containsKey('groups')) { return []; } $groups = $attributes->get('groups')->get();
Is there a better way?
The text was updated successfully, but these errors were encountered:
Groups inside the context are there only for the group exclusion strategy proposes.
If you need to access them, you can set them explicitly in the "serialization" attributes and use them as you prefer
Sorry, something went wrong.
No branches or pull requests
We can set groups on the context as defined here: https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Context.php#L168
But theres no simple method for fetching them.
This usually results in me having to do the following code in every listener...
Is there a better way?
The text was updated successfully, but these errors were encountered: