I am upgrading from PHP7 to PHP8, ran my doctrine entities through Rector to update the annotations to attributes. I’m getting the following error that I cannot get past:
<code>Attribute "DoctrineORMMappingOneToMany" cannot target method (allowed targets: property)
</code>
<code>Attribute "DoctrineORMMappingOneToMany" cannot target method (allowed targets: property)
</code>
Attribute "DoctrineORMMappingOneToMany" cannot target method (allowed targets: property)
Here’s my attribute code on the entity that I’m calling find()
on so I’m assuming it’s the entity causing the issue.
<code> #[OneToMany(targetEntity: TransactionReceiptCode::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $rc_breakddown;
#[OneToMany(targetEntity: TransactionFee::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $fees;
</code>
<code> #[OneToMany(targetEntity: TransactionReceiptCode::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $rc_breakddown;
#[OneToMany(targetEntity: TransactionFee::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $fees;
</code>
#[OneToMany(targetEntity: TransactionReceiptCode::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $rc_breakddown;
#[OneToMany(targetEntity: TransactionFee::class, mappedBy: 'transaction', cascade: ['persist'])]
protected $fees;
Any information to track down the issue would be appreciated.