Skip to content

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

@rvanlaak

Description

@rvanlaak

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy