Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions source/blog/2022-01-11-orm-2.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,25 @@ Another PHP 8.1 feature is the new readonly keyword that prevents the value of
a property to be written again after it has been initialized in the constructor
of an object.

With ORM 2.11 the support now works as you would expect with no additional
mapping options necessary:
With ORM 2.11 the support now works only for entities which use the "NONE"
strategy for identifier generator:

```php
#[Entity, Table(name: 'author')]
class Author
{
#[Column, Id, GeneratedValue]
#[Column, Id, GeneratedValue(strategy: 'NONE')]
private readonly int $id;

#[Column]
private readonly string $name;
}
```

For entities which use another strategy for their identifier generator,
it will not work because when an entity is removed, the Unit of Work
will try to set the value of the identifier as `null` which is not possible.

## AssociationOverrides and AttributeOverrides in Attribute Driver

The new `AttributeDriver` for PHP 8 did not support the equivalent mapping
Expand Down