Answer the question
In order to leave comments, you need to log in
How to request another entity in repositoty?
Hello everyone
1) There is a Room entity, it has a RoomRepository (where we write all requests, etc.).
2) There is a Door entity, it has a DoorRepository (where we write all requests, etc.).
How can I make a joint with the Door entity in the RoomRepository? How can I send it there?
Answer the question
In order to leave comments, you need to log in
$qb = $this->createQueryBuilder('room')
->join('room.doors', 'd')
return $qb->getQuery()->getResult();
/**
* @var \Doctrine\Common\Collections\Collection
* @ORM\OneToMany(targetEntity="Applications\Entity\Offer", mappedBy="application", cascade={"persist"})
*/
private $offers;
/**
* @ORM\ManyToOne(targetEntity="Applications\Entity\Application", inversedBy="offers")
* @ORM\JoinColumn(name="application_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
*/
private $application;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question