protected function initRelation(Block $block, $timetable) { $externalStopPointId = $block->getStopPoint(); // all blocks are linked at least to a timetable $this->block->setTimetable($timetable); if (!empty($externalStopPointId)) { // link block to this stop point $this->block->setStopPoint($this->getStopPointReference($externalStopPointId, $timetable)); } }