So I have an Experiment Entity which has many RNASeq entities. However, when I try to save an Experiment with an RNASeq entry (via the newAction
), only the Expe
This is a very common issue. You need to take care of cross referencing your objects. Doctrine does not do this automatically though many people initially seem to think it will.
class Experiment {
public function addRNASeq($seq) {
$this->seqs[] = $seq;
$seq->setExperiment($this); // This is what you are missing
And add the attribute cascade=all to your Experiment::seqs property. Then you won't need to explicitly persist the seq entities.