I have a table that has composite primary key: id + est_date. And it has an entity:
class Parent
{
/**
* @ORMId
*/
private $id;
/**
* @ORMId
*/
private int $estDate;
...
}
Now I need to create a related table and its entity.
class Child
{
...
/**
* don't know what to write here
*/
private $parentId;
/**
* don't know what to write here
*/
private int $parentEstDate;
...
}
How to discribe relation ManyToOne (many “Child” entities may relate to 1 “Parent”)? And the second issue is – “estDate” of the “Parent” may change. How to specify cascade update in “Child”?
Please don’t write that doctrine doesn’t recomment to use composite keys. I know that.