Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] fixed EntityType choice options#6444

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@HeahDude
Copy link
Contributor

QA
branch2.7+
doc fixyes

We should point these overridden options from theChoiceType, so users keep the benefit of the optimization made in theDoctrineChoiceLoader.

2.7, it was called ``property`` (which has the same functionality).

**type**: ``string``or``callable``
**type**: ``string``, ``callable``or:class:``Symfony\\Component\\PropertyAccess\\PropertyPath``
Copy link
Member

Choose a reason for hiding this comment

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

Minor syntax issue:

:class:``Symfony\\Component\\PropertyAccess\\PropertyPath``

should be:

:class:`Symfony\\Component\\PropertyAccess\\PropertyPath`

@HeahDude
Copy link
ContributorAuthor

Thanks@javiereguiluz for those feedbacks, I'll work on it :)

@HeahDudeHeahDudeforce-pushed thecaution/entity_type-choice_options branch fromf7d73a7 tocd6fe11CompareApril 9, 2016 12:19
@HeahDude
Copy link
ContributorAuthor

Comments addressed. Needs comments, thanks!

@HeahDudeHeahDudeforce-pushed thecaution/entity_type-choice_options branch fromcd6fe11 tobf13394CompareApril 9, 2016 12:21

**type**: ``string``, ``callable`` or:class:`Symfony\\Component\\PropertyAccess\\PropertyPath` **default**: id

By default the name of each field is the id of the entity, if it can be get in

Choose a reason for hiding this comment

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

Reading this paragraph I wonder: what will be the default value if the "id reader" can't read the id of the object?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@javiereguiluz The loader just doesn't use it, and falls back on the default process (casting objects to string or using incremental integer). Do you think we should add this ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

"[...] if it can be get in the class metadata [...]" => "[...] if it can be read from the class metadata [...]" ?

@HeahDudeHeahDudeforce-pushed thecaution/entity_type-choice_options branch frombf13394 to1d058a5CompareMay 1, 2016 12:23
@HeahDude
Copy link
ContributorAuthor

Updated!


By default the name of each field is the id of the entity, if it can be read
from the class metadata by an internal id reader. Otherwise the process will
fall back on an incremental integer.
Copy link
Member

Choose a reason for hiding this comment

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

[...] fall back to using increasing integers?

@HeahDude
Copy link
ContributorAuthor

Thanks@xabbuh for the review, I addressed your comments in the last pushed commit.

@xabbuh
Copy link
Member

👍

@xabbuh
Copy link
Member

@javiereguiluz
Copy link
Member

I'm sorry but I can't vote on this because I don't understand the Form component well enough.

@HeahDudeHeahDudeforce-pushed thecaution/entity_type-choice_options branch fromc389bc9 to302afe5CompareMay 21, 2016 10:11
@HeahDude
Copy link
ContributorAuthor

Squashed, should be ready to be merged. Thanks!

@weaverryanweaverryan merged commit302afe5 intosymfony:2.7May 22, 2016
weaverryan added a commit that referenced this pull requestMay 22, 2016
This PR was merged into the 2.7 branch.Discussion----------[Form] fixed EntityType choice options| Q | A ||-----------|-------|| branch | 2.7+ || doc fix | yesWe should point these overridden options from the `ChoiceType`, so users keep the benefit of the optimization made in the `DoctrineChoiceLoader`.Commits-------302afe5 [Form] fixed EntityType choice options
@weaverryan
Copy link
Member

Merged! But, I think I merged too quickly - I opened#6600 with some tweaks I wanted, but I would love your input@HeahDude :)

Thanks!

@HeahDudeHeahDude deleted the caution/entity_type-choice_options branchMay 23, 2016 08:40
weaverryan added a commit that referenced this pull requestJul 10, 2016
This PR was merged into the 2.7 branch.Discussion----------Removing some extra details from#6444See#6444 - I wanted to accomplish 2 things:1) Ideally remove needing to duplicate the option - i.e. *try* to re-use the existing `.inc` file, as long as things remain clear. Also, the original `.inc` actually explain what the point of the option is.2) Removing some extra low-level details that I'm not sure are understandable.The only thing I wasn't sure about was related to `choice_values`. If I'm using an API, and I want the user to be able to submit some string (e.g. the `username` for a User instead of the id), is this possible by setting this to `username`? Or will that mess up how the entities are queried?Commits-------2336e88 Trying to remove some duplication and some extra details
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@HeahDude@xabbuh@javiereguiluz@weaverryan

[8]ページ先頭

©2009-2025 Movatter.jp