*/ #[ORM\ManyToMany(targetEntity: Socket::class, inversedBy: 'previously_owned_cpu', fetch: 'LAZY')] #[ORM\JoinTable('collection.previously_owned_cpu_socket_link')] #[ORM\JoinColumn('cpu_id', referencedColumnName: 'id')] #[ORM\InverseJoinColumn('socket_id', referencedColumnName: 'id')] #[ORM\OrderBy(['name' => 'asc'])] private Collection $sockets; // ------------------------------------------------------------------------ public function __construct() { $this->sockets = new ArrayCollection(); } public function addSocket(Socket $socket): self { if ( ! $this->sockets->contains($socket)) { $this->sockets->add($socket); } return $this; } public function removeSocket(Socket $socket): self { $this->sockets->removeElement($socket); return $this; } }