是否可以创建从一个实体A到实体B的映射,而只是在实体A中存储一个只包含相关实体B的ID的数组。
class A
{
/**
* @var int
*/
protected $id;
/**
* @var int[] One to many relationship which only has the ID's of class B
*/
private $bIds;
...
}
class B
{
/**
* @var int
*/
protected $id;
/**
* @var A Many to one relationship
*/
private $a;
}