Skip to content

Mention the adder/remover support of PropertyInfo #9195

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

Closed
wants to merge 2 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #7182.

@dunglas
Copy link
Member

dunglas commented Feb 2, 2018

Perfect. Thank you very much for documenting this @javiereguiluz!

@dunglas
Copy link
Member

dunglas commented Feb 2, 2018

After a second check, I think that the property will be considered writable if it has associated adder and remover methods. If only one of them is present, the PropertyAccessor component cannot update reliably the array, and so doesn't do it.

Should be:

<?php

<?php

class SomeClass
{
    private $analyses;
    private $feet;

    public function addAnalyse(Dummy $analyse)
    {
        // ...
    }

    public function removeAnalyse(Dummy $analyse)
    {
        // ...
    }

    public function addFoot(Dummy $foot)
    {
        // ...
    }

    public function removeFoot(Dummy $foot)
    {
        // ...
    }
}

@javiereguiluz
Copy link
Member Author

Thanks for reviewing Kévin. This is a bit confusing, because I took the original example from the tests of your pull request: https://github.com/symfony/symfony/pull/18337/files#diff-cf4f68ffc8f26be7f990461bb282f50cR126

@javiereguiluz
Copy link
Member Author

I have checked this again and you are right ... it checks by default both array mutator methods (add and remove) to determine if it's writable or not. Thanks!

javiereguiluz added a commit that referenced this pull request Mar 19, 2018
…eguiluz)

This PR was squashed before being merged into the 3.4 branch (closes #9195).

Discussion
----------

Mention the adder/remover support of PropertyInfo

This fixes #7182.

Commits
-------

620439a Mention the adder/remover support of PropertyInfo
xabbuh added a commit that referenced this pull request Mar 21, 2018
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Mar 26, 2018
* 3.4: (21 commits)
  added Sam in the core team
  minor symfony#9494 [Console] Change use statement for Process Helper (krizon)
  Specify how provide a high availability
  Use FQCN as service ID
  [symfony#8847] fix another directive
  [symfony#8847] fix tip directive
  Describe reliability in Lock
  Propose identical comparison
  [symfony#9195] fix a minor typo
  Fixed some variable names
  fix some security config examples
  Made explicit testing dependencies
  No more ambiguity on prod mode
  Mention the adder/remover support of PropertyInfo
  ...
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request Mar 26, 2018
* 4.0: (24 commits)
  added Sam in the core team
  minor symfony#9494 [Console] Change use statement for Process Helper (krizon)
  Specify how provide a high availability
  fixing format + language
  Documenting make:controller and make:crud
  Use FQCN as service ID
  Describe reliability in Lock
  Propose identical comparison
  [symfony#9195] fix a minor typo
  Fixed some variable names
  fix some security config examples
  Made explicit testing dependencies
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants