Skip to content

Document the mapped form type option #1973

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

Merged
merged 5 commits into from
Nov 28, 2012
Merged

Conversation

greg0ire
Copy link
Contributor

I didn't document the default value, I suppose it is true, because I don't know if there is one or if this option is just ignored when not set (I think it is the latter when looking at FormType.php).

@greg0ire
Copy link
Contributor Author

This option seems to be there since 2.1, hence the pull request branch.

@@ -0,0 +1,7 @@
property_path
Copy link
Member

Choose a reason for hiding this comment

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

Oops :) - be sure to change this to "mapped"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is what you get when copy/pasting too hastily :P Good catch!

@@ -12,3 +12,6 @@ name.

If you wish the field to be ignored when reading or writing to the object
you can set the ``property_path`` option to ``false``

.. versionadded:: 2.1
Since 2.1, the ``mapped`` option has been added for this use-case
Copy link
Member

Choose a reason for hiding this comment

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

This is a perfect note, but actually the entire previous sentence needs to be changed as well. Setting property_path to false only works for 2.0, mapped completely replaces that for 2.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you dead sure about this? I just checked out origin/2.1, and there is a comment suggesting otherwise right here : https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/Form/Extension/Core/Type/FormType.php#L187 ...

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think it's just there fore backwards compatibility. So, we should say that using property_path => false to disable mapping is now deprecated and to use mapped instead.

Copy link
Member

Choose a reason for hiding this comment

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

indeed, it is only kept for BC until 2.3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weaverryan : I added something to point that out.

weaverryan added a commit that referenced this pull request Nov 28, 2012
Document the mapped form type option
@weaverryan weaverryan merged commit 9e2363d into symfony:2.1 Nov 28, 2012
@weaverryan
Copy link
Member

Awesome Grégoire!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants