private function getTopMilestones(PFUser $user, Project $project)
 {
     $top_milestones = array();
     $milestones = $this->milestone_factory->getSubMilestones($user, $this->milestone_factory->getVirtualTopMilestone($user, $project));
     foreach ($milestones as $milestone) {
         $top_milestones[] = $milestone;
     }
     return $top_milestones;
 }
 private function loadMilestone()
 {
     if (!isset($this->additional_criteria[self::FIELD_NAME])) {
         return;
     }
     if ($this->additional_criteria[self::FIELD_NAME]->getValue() == self::TOP_BACKLOG_IDENTIFIER) {
         $this->milestone = $this->milestone_factory->getVirtualTopMilestone($this->user, $this->project);
         return;
     }
     $this->milestone = $this->milestone_factory->getBareMilestoneByArtifactId($this->user, $this->additional_criteria[self::FIELD_NAME]->getValue());
     $this->milestone_has_been_loaded = true;
 }
 /**
  * @throws IdsFromBodyAreNotUniqueException
  * @throws ArtifactIsNotInUnassignedTopBacklogItemsException
  */
 public function validateArtifactIdsAreInUnassignedTopBacklog(array $ids, PFUser $user, Project $project)
 {
     $this->validateIdsAreUnique($ids);
     $top_milestone = $this->milestone_factory->getVirtualTopMilestone($user, $project);
     $strategy_unassigned = $this->backlog_strategy_factory->getSelfBacklogStrategy($top_milestone);
     $unassigned = $this->backlog_item_collection_factory->getUnassignedCollection($user, $top_milestone, $strategy_unassigned, false);
     foreach ($ids as $id) {
         if (!$unassigned->containsId($id)) {
             throw new ArtifactIsNotInUnassignedTopBacklogItemsException($id);
         }
     }
     return true;
 }
 private function generateVirtualTopMilestone()
 {
     $this->milestone = $this->milestone_factory->getVirtualTopMilestone($this->getCurrentUser(), $this->project);
 }