orm
orm copied to clipboard
Update ObjectHydrator.php
correction for bug when multiple calls :
when I automaticly made a DQL like :
return $this
->createQueryBuilder('s0_')
->leftJoin('s0_.itemSeries','i1_')->addSelect('i1_')
->leftJoin('i1_.item','i2_')->addSelect('i2_')
->leftJoin('s0_.serieImportators','s4_')->addSelect('s4_')
->leftJoin('s4_.serie','s5_')->addSelect('s5_')
->leftJoin('s5_.itemSeries','i6_')->addSelect('i6_')
ItemSerie Entity :
class ItemSerie
{
#[ORM\Id]
#[ORM\ManyToOne( inversedBy: 'itemSeries')]
#[ORM\JoinColumn(nullable: false)]
private ?Item $item = null;
#[ORM\Id]
#[ORM\ManyToOne( inversedBy: 'itemSeries')]
#[ORM\JoinColumn(nullable: false)]
private ?Serie $serie = null;
#[ORM\Column(type: 'string', length: 50)]
private $numero;
...
}
on each series, the last itemSeries has the good number but the item witch is associate is bad, it take the second of list