orm
orm copied to clipboard
Property "*" in "*" was already declared, but it must be declared only once
Hello!
I'm trying to convert the SQL-file to Doctrine Entities. https://raw.githubusercontent.com/php-telegram-bot/core/master/structure.sql As I know, I should to use command in console:
./vendor/bin/doctrine orm:convert-mapping php src/ --from-database --force
But I've got an error...
Property "chat" in "EditedMessage" was already declared, but it must be declared only once
How can I fix it?
Thank you a lot!
Suffering a similar bug here
Please evaluate your similar bug with the installed versions and an example of your code that will run into your problem.
I'm encountering this exact bug while upgrading to ORM 3, from the latest patches in the 2.x series. DBAL was already on 3.
I think the trigger is in this chain:
abstract class BaseTimeblameableEntity
{
/**
* @var User|null
*/
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(name: 'created_by', nullable: false)]
#[Gedmo\Blameable(on: 'create')]
protected $createdBy;
// ...
}
#[ORM\Table(name: 'export_shutdown_bc')]
#[ORM\InheritanceType('SINGLE_TABLE')]
#[ORM\DiscriminatorColumn(name: 'discr', type: 'string', length: 20)]
#[ORM\DiscriminatorMap(['active' => 'ShutdownExportActive', 'passive' => 'ShutdownExportPassive'])]
#[ORM\Entity(repositoryClass: AbstractExportShutdownRepository::class)]
abstract class AbstractExportShutdown extends BaseTimeblameableEntity
{
// ...
}
#[ORM\Entity]
class ShutdownExportActive extends AbstractExportShutdown {}
I'll try to extract it and slim it down to verify my assumption.
Reproduced in #11523, I should add that this doesn't happen if the relation is coming from a trait instead of an abstract class.