public function findFirstSubmilestoneTracker(Planning_Milestone $milestone)
 {
     $children = $this->hierarchy_factory->getChildren($milestone->getTrackerId());
     if (!$children) {
         return null;
     }
     $milestone_backlog_trackers = $milestone->getPlanning()->getBacklogTrackers();
     foreach ($milestone_backlog_trackers as $milestone_backlog_tracker) {
         foreach ($children as $tracker) {
             $planning = $this->planning_factory->getPlanningByPlanningTracker($tracker);
             if (!$planning) {
                 continue;
             }
             $planning_backlog_trackers = $planning->getBacklogTrackers();
             foreach ($planning_backlog_trackers as $planning_backlog_tracker) {
                 if ($milestone_backlog_tracker == $planning_backlog_tracker) {
                     return $tracker;
                 }
                 $backlog_tracker_ancestors = $this->hierarchy_factory->getAllParents($planning_backlog_tracker);
                 if (in_array($milestone_backlog_tracker, $backlog_tracker_ancestors)) {
                     return $tracker;
                 }
             }
         }
     }
 }
 /** @return Tracker[] */
 private function getParentsWithPlanningAndOrderedFromTopToBottom(Tracker $nearest_planning_tracker)
 {
     $parents = $this->hierarchy_factory->getAllParents($nearest_planning_tracker);
     $parents = $this->keepsTrackersUntilThereIsNoPlanning($parents);
     $parents = array_reverse($parents);
     $parents[] = $nearest_planning_tracker;
     return $parents;
 }