Skip to content

[ObjectMapper] Promoted properties do not seem to update #60790

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

Open
rvanlaak opened this issue Jun 14, 2025 · 0 comments
Open

[ObjectMapper] Promoted properties do not seem to update #60790

rvanlaak opened this issue Jun 14, 2025 · 0 comments

Comments

@rvanlaak
Copy link
Contributor

Symfony version(s) affected

7.3.0

Description

Am using a input DTO (and API Platform), and it seems that solely the promoted property on the constructor of the Doctrine Entity does not get updated.

How to reproduce

Situation that does not work

With the code below the name on the Bar entity does not get changed.

final class BarUpdateInput
{
    public string $name;
}

#[ORM\Entity]
class Bar
{
    #[ORM\Id]
    public string $id;

    public function __construct(
        #[ORM\Column]
        public string $name;
    ) {
}

Situation that does work

final class BarUpdateInput
{
    public string $name;
}

#[ORM\Entity]
class Bar
{
    #[ORM\Id]
    public string $id;

    #[ORM\Column]
    public string $name;

    public function __construct(
        string $name,
    ) {
}

``

### Possible Solution

Probably the `ObjectMapper:87-101` code needs some tweaking to map changes on existing Doctrine entity objects as well.

### Additional Context

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

No branches or pull requests

2 participants