Answer the question
In order to leave comments, you need to log in
How to create dependencies of external tables with a SQL query through a repository?
PointsController.php on line 150:
App\Entity\PointsCities {#709 ▼
-id: "1"
-city: "City #1"
-region_id: "2"
-type: 1
}
class PointsCities
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="bigint", options={"unsigned" : true})
*/
private $id;
/**
* @ORM\Column(type="string", length=50)
*/
private $city;
/**
* @ORM\Column(type="bigint", nullable=true, options={"unsigned" : true})
* @ORM\ManyToOne(targetEntity="PointsRegions")
* @ORM\JoinColumn(name="region_id", referencedColumnName="id")
*/
private $region_id;
/**
* @ORM\Column(type="smallint", options={"unsigned" : true})
* @ORM\OneToOne(targetEntity="PointsCityTypes")
*/
private $type;
........
}
Answer the question
In order to leave comments, you need to log in
in essence, you need to create an ArrayCollection
one-to-many
variable names should be CamelCase, instead of $region_id you need $regions
about Join doctrina works on pattern proxy
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question