我通过实体Hotel
与实体Airport
建立了多对多关系的Distanсe
实体
/**
*
* @Table(name="Hotel")
* @Entity
*/
class Hotel
{
/**
* @Column(name="hotel_id", type="integer")
* @Id
* @GeneratedValue(strategy="IDENTITY")
*/
private $hotel_id;
}
/**
*
* @Table(name="Airport")
* @Entity
*/
class Airport
{
/**
* @Column(name="airport_id", type="integer")
* @Id
* @GeneratedValue(strategy="IDENTITY")
*/
private $airport_id;
}
我不知道如何描述与Distance
类的关联?
/**
*
* @Table(name="Distance")
* @Entity
*/
class Distance
{
private $airport_id;
private $hotel_id;
/**
* @Column(name="distance", type="integer")
*
*/
private $distance;
}