/** * Entity manager mock returned values for 'find()' method * @return array */ public function getEntityMap() { $testPlanning = new Planning(); $testPlanning->setId(1); $testPlanning->setDate(new \DateTime('2015-12-25 00:00:00+02:02')); $testBatch = new Batch(); $testBatch->setId(2); $testBatch->setStartTime(new \DateTime('2015-12-25 00:00:00+02:02')); return [['Application\\Model\\Planning\\Planning', '1', null, null, $testPlanning], ['Application\\Model\\Planning\\Batch', '1', null, null, $testBatch]]; }
/** * Exchange internal values from provided array * @param array $array * @return void */ public function exchangeArray(array $array) { $this->id = $array['id']; $this->date = new \DateTime($array['date']); if (isset($array['batches'])) { $this->batches = new ArrayCollection(); foreach ($array['batches'] as $batchData) { $batch = new Batch(); $batch->exchangeArray($batchData); $this->batches->add($batch); } } }