当前位置: 首页>>代码示例>>PHP>>正文


PHP Tracker_Artifact::getAllAncestors方法代码示例

本文整理汇总了PHP中Tracker_Artifact::getAllAncestors方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_Artifact::getAllAncestors方法的具体用法?PHP Tracker_Artifact::getAllAncestors怎么用?PHP Tracker_Artifact::getAllAncestors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracker_Artifact的用法示例。


在下文中一共展示了Tracker_Artifact::getAllAncestors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: linkWithParents

 public function linkWithParents(Codendi_Request $request, Tracker_Artifact $artifact)
 {
     $user = $request->getCurrentUser();
     $ancestors = $artifact->getAllAncestors($user);
     if (count($ancestors) == 0) {
         $artifact_id = (int) $request->getValidated('link-artifact-id', 'uint', 0);
         $source_artifact = $this->artifact_factory->getArtifactById($artifact_id);
         if ($source_artifact) {
             foreach ($source_artifact->getAllAncestors($user) as $ancestor) {
                 $ancestor->linkArtifact($artifact->getId(), $user);
             }
         }
     }
 }
开发者ID:nickl-,项目名称:tuleap,代码行数:14,代码来源:ArtifactLinker.class.php

示例2: linkWithMilestoneArtifact

 private function linkWithMilestoneArtifact(User $user, Tracker_Artifact $artifact, Tracker_Artifact $source_artifact = null)
 {
     $last_ancestor = $source_artifact;
     if ($source_artifact) {
         foreach ($source_artifact->getAllAncestors($user) as $ancestor) {
             $planning = $this->planning_factory->getPlanningByPlanningTracker($ancestor->getTracker());
             if ($planning && $planning->getBacklogTracker() == $artifact->getTracker()) {
                 $ancestor->linkArtifact($artifact->getId(), $user);
                 $last_ancestor = $ancestor;
             }
         }
     }
     return $last_ancestor;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:14,代码来源:ArtifactLinker.class.php

示例3: redirectToParentCreationIfNeeded

 protected function redirectToParentCreationIfNeeded(Tracker_Artifact $artifact, User $current_user, Tracker_Artifact_Redirect $redirect)
 {
     $parent_tracker = $this->tracker->getParent();
     if ($parent_tracker) {
         if (count($artifact->getAllAncestors($current_user)) == 0) {
             $art_link = $this->formelement_factory->getAnArtifactLinkField($current_user, $parent_tracker);
             if ($art_link) {
                 $art_link_key = 'artifact[' . $art_link->getId() . '][new_values]';
                 $redirect_params = array('tracker' => $parent_tracker->getId(), 'func' => 'new-artifact', $art_link_key => $artifact->getId());
                 $redirect->mode = Tracker_Artifact_Redirect::STATE_CREATE_PARENT;
                 $redirect->query_parameters = $redirect_params;
             }
         }
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:15,代码来源:CreateArtifact.class.php


注:本文中的Tracker_Artifact::getAllAncestors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。