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 View::$entity property for entity access #2192

Merged
merged 11 commits into from
Mar 27, 2024
Merged

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Mar 26, 2024

In 99% cases the impact is on Form::$model property usage. Seach form->model in your codebase and replace it with form->entity.

The motivation is to simplify model/entity orientation for the developer. When Model is guaranteed to be entity only, is should never be named model.

@mvorisek mvorisek added the MAJOR label Mar 26, 2024
@mvorisek mvorisek changed the title Introduce View::$entity property for entity access Use View::$entity property for entity access Mar 26, 2024
@mvorisek mvorisek marked this pull request as ready for review March 27, 2024 08:54
docs/form-control.md Outdated Show resolved Hide resolved
Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

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

Minor comments, but didn't review all toughly.

I guess i understand the purpose, but it will make life a bit more complicated for programmer to remember that form views have entity, but grid views have model.
I do not have a lot of up to date code, but time ago using $form->model was quite a common case. Especially in form submit callback.

@mvorisek mvorisek merged commit accdc77 into develop Mar 27, 2024
48 checks passed
@mvorisek mvorisek deleted the form_entity_property branch March 27, 2024 18:41
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

2 participants