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

Use constant for batch, select and actions fields #6957

Merged
merged 1 commit into from
Mar 21, 2021

Conversation

VincentLanglet
Copy link
Member

@VincentLanglet VincentLanglet commented Mar 21, 2021

Subject

BC

As you can see, we're using _actions for the name of actions, but batch and select for the others.
It could create a conflict if someone want to display an entity which has a select field.
So I recommend to prefix by _ in Next major.

Changelog

### Added
- Added constant `ListMapper::NAME_ACTIONS` to use instead of `_action`
- Added constant `ListMapper::NAME_SELECT` to use instead of `select`
- Added constant `ListMapper::NAME_BATCH` to use instead of `batch`

### Deprecated
- Relying on the code `_select` or `_batch` to determine if a field description is a `select` or a `batch` one. You should rely on the name `ListMapper::NAME_SELECT` or `ListMapper::NAME_BATCH` instead.

phansys
phansys previously approved these changes Mar 21, 2021
@VincentLanglet VincentLanglet requested a review from a team March 21, 2021 15:55
franmomu
franmomu previously approved these changes Mar 21, 2021
@@ -28,6 +28,12 @@
*/
class ListMapper extends BaseMapper
{
public const NAME_ACTIONS = '_action';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should either call it in singular or change it to _actions in next major version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment.

@VincentLanglet VincentLanglet dismissed stale reviews from franmomu and phansys via 0c75352 March 21, 2021 18:48
@VincentLanglet VincentLanglet merged commit d4837ab into sonata-project:3.x Mar 21, 2021
@VincentLanglet VincentLanglet deleted the constants branch March 21, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants