Skip to content

Use View::$entity property for entity access#2192

Merged
mvorisek merged 11 commits intodevelopfrom
form_entity_property
Mar 27, 2024
Merged

Use View::$entity property for entity access#2192
mvorisek merged 11 commits intodevelopfrom
form_entity_property

Conversation

@mvorisek
Copy link
Copy Markdown
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 force-pushed the form_entity_property branch from dfab4e3 to 7f9be35 Compare March 26, 2024 15:34
@mvorisek mvorisek marked this pull request as ready for review March 27, 2024 08:54
@mvorisek mvorisek force-pushed the form_entity_property branch from aa80922 to 41d5803 Compare March 27, 2024 09:10
@mvorisek mvorisek force-pushed the form_entity_property branch from 6027f62 to 1a6f47f Compare March 27, 2024 10:22
@mvorisek mvorisek force-pushed the form_entity_property branch from b8b507f to 701161b Compare March 27, 2024 10:44
Copy link
Copy Markdown
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
@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

Development

Successfully merging this pull request may close these issues.

2 participants