Skip to content

Conversation

@octoseth
Copy link
Contributor

@octoseth octoseth commented Dec 7, 2024

When generating a new entity, if we name a boolean property with the prefix "is", this prefix is removed to construct the setter.

example:

bool $isInternational;

public function isInternational(): ?bool
{
   return $this->isInternational;
}

public function setInternational(bool $isInternational): static
{
   $this->isInternational = $isInternational;

   return $this;
}

This is breaking when we want to access the property via a form :

[NoSuchPropertyException]
HTTP 500 Internal Server Error
The method "isInternational" in class "App\Entity\Conference" requires 0 arguments, but should accept only 1.. Make the property public, add a setter, or set the "mapped" field option in the form type to be false.

This PR revert this change introduce in PR 1493 to keep the 'is' prefix on the setter.

example :

public function setIsInternational(bool $isInternational): static 
{
    $this->isInternational = $isInternational;

    return $this;
}

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

My bad for #1493 (review)

@kbond
Copy link
Member

kbond commented Dec 10, 2024

Thank you @octoseth.

@kbond kbond merged commit d2b260c into symfony:main Dec 10, 2024
8 of 9 checks passed
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