I have a parent entity which is referring to a child entity and the classes are written as follows:
class MyEntity {
/**
* ORM Annotations
*/
private $id;
/**
* ORM Annotations
*/
private $name;
/**
* @var string
* @ORM\OneToOne(targetEntity="Picture")
*/
private $image;
/** Getters & Setters **/
}
private Image {
private $id;
private $image_url;
}
Here, Image is a weak entity and I don't want to insert image before inserting MyEntity
object. Basically, my question is, how can I render the form for MyEntity
so that, Image
form appears as a part of it, and image get saved when I save MyEntity
.