refactor(constructeur) : replace ManyToMany with OneToMany to ConstructeurLink entities
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-18
@@ -63,37 +63,37 @@ class Constructeur
|
||||
private DateTimeImmutable $updatedAt;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Machine>
|
||||
* @var Collection<int, MachineConstructeurLink>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Machine::class, mappedBy: 'constructeurs')]
|
||||
private Collection $machines;
|
||||
#[ORM\OneToMany(mappedBy: 'constructeur', targetEntity: MachineConstructeurLink::class, cascade: ['remove'])]
|
||||
private Collection $machineLinks;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Composant>
|
||||
* @var Collection<int, ComposantConstructeurLink>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Composant::class, mappedBy: 'constructeurs')]
|
||||
private Collection $composants;
|
||||
#[ORM\OneToMany(mappedBy: 'constructeur', targetEntity: ComposantConstructeurLink::class, cascade: ['remove'])]
|
||||
private Collection $composantLinks;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Piece>
|
||||
* @var Collection<int, PieceConstructeurLink>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Piece::class, mappedBy: 'constructeurs')]
|
||||
private Collection $pieces;
|
||||
#[ORM\OneToMany(mappedBy: 'constructeur', targetEntity: PieceConstructeurLink::class, cascade: ['remove'])]
|
||||
private Collection $pieceLinks;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Product>
|
||||
* @var Collection<int, ProductConstructeurLink>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: 'constructeurs')]
|
||||
private Collection $products;
|
||||
#[ORM\OneToMany(mappedBy: 'constructeur', targetEntity: ProductConstructeurLink::class, cascade: ['remove'])]
|
||||
private Collection $productLinks;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->createdAt = new DateTimeImmutable();
|
||||
$this->updatedAt = new DateTimeImmutable();
|
||||
$this->machines = new ArrayCollection();
|
||||
$this->composants = new ArrayCollection();
|
||||
$this->pieces = new ArrayCollection();
|
||||
$this->products = new ArrayCollection();
|
||||
$this->createdAt = new DateTimeImmutable();
|
||||
$this->updatedAt = new DateTimeImmutable();
|
||||
$this->machineLinks = new ArrayCollection();
|
||||
$this->composantLinks = new ArrayCollection();
|
||||
$this->pieceLinks = new ArrayCollection();
|
||||
$this->productLinks = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
|
||||
Reference in New Issue
Block a user