Skip to content

[3.4.0, PHP <8.4] Cannot hydrate readonly properties from superclass of embeddable #11991

Open
@udavka

Description

@udavka

Bug Report

Q A
Version 3.4.0
PHP version <8.4.0

Summary

For embeddables that have superclasses, the hydrator cannot set readonly properties that are inherited from a superclass (for PHP <8.4).

Current behavior

Inherited readonly properties cannot be set and an exception is thrown: Error: Cannot initialize readonly property <super-class>::$<prop-name> from scope <derived-class>. The entity hydration is terminated.
The problem is introduced in 3.4.0 with new property accessors. The previous reflection property-based code still works, but it is not used in the hydration code anymore.

Expected behavior

The hydration is successful.

How to reproduce

Just use an embeddable with a superclass that has a readonly ORM column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions