You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This yields an error from phpstan (I know I can silence it):
Property App\Entity\User::$unreadComments is never written, only read.
This made me look at the 'generated' option and when adding generated: 'NEVER' to the column options I get the following error:
Typed property Doctrine\ORM\Mapping\FieldMapping::$generated must not be accessed before initialization
When adding generated: 'INSERT' to the column options, phpstan will be silent, but a SELECT is done after UPDATE to the entity.
Expected behavior
generated: 'NEVER' should not yield an error and should not refresh field after update or insert. generated: 'INSERT' should refresh the field after insert, but not after update?
Documentation says generated: An enum with the possible values ALWAYS, INSERT, NEVER. Is used after an INSERT or UPDATE statement to determine if the database generated this value and it needs to be fetched using a SELECT statement.
What is the default?
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
Using the Column option
generated: 'NEVER'
yields an error:Typed property Doctrine\ORM\Mapping\FieldMapping::$generated must not be accessed before initialization
Current behavior
Using the Column option
generated: 'NEVER'
yields an error andgenerated: 'INSERT'
works unexpectedly.How to reproduce
Using a database trigger to update a field defined as such:
This yields an error from phpstan (I know I can silence it):
Property App\Entity\User::$unreadComments is never written, only read.
This made me look at the 'generated' option and when adding
generated: 'NEVER'
to the column options I get the following error:Typed property Doctrine\ORM\Mapping\FieldMapping::$generated must not be accessed before initialization
When adding
generated: 'INSERT'
to the column options, phpstan will be silent, but a SELECT is done after UPDATE to the entity.Expected behavior
generated: 'NEVER'
should not yield an error and should not refresh field after update or insert.generated: 'INSERT'
should refresh the field after insert, but not after update?Documentation says generated: An enum with the possible values ALWAYS, INSERT, NEVER. Is used after an INSERT or UPDATE statement to determine if the database generated this value and it needs to be fetched using a SELECT statement.
What is the default?
The text was updated successfully, but these errors were encountered: