本文整理汇总了PHP中Tracker_Artifact::getLinkedArtifacts方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_Artifact::getLinkedArtifacts方法的具体用法?PHP Tracker_Artifact::getLinkedArtifacts怎么用?PHP Tracker_Artifact::getLinkedArtifacts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker_Artifact
的用法示例。
在下文中一共展示了Tracker_Artifact::getLinkedArtifacts方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchArtifactLinks
/**
* @param PFUser $current_user
* @return Tracker_Artifact_Presenter_ArtifactLinkPresenter[]
*/
private function fetchArtifactLinks(PFUser $current_user)
{
$linked_artifacts = $this->artifact->getLinkedArtifacts($current_user);
$links = array();
foreach ($linked_artifacts as $artifact) {
$artifact_title = $artifact->getTitle();
$artifact_link = new Tracker_Artifact_Presenter_ArtifactLinkPresenter($artifact->getTracker()->getItemName(), $artifact->getTracker()->getProject()->getID(), $artifact->getId(), $artifact_title ? $artifact_title : '');
$links[] = $artifact_link;
}
return $links;
}
示例2: getComputedValue
/**
* Given an artifact, return a numerical value of the field for this artifact.
*
* @param User $user The user who see the results
* @param Tracker_Artifact $artifact The artifact on which the value is computed
* @param Array $computed_artifact_ids Hash map to store artifacts already computed (avoid cycles)
*
* @return float
*/
public function getComputedValue(User $user, Tracker_Artifact $artifact, $timestamp = null, &$computed_artifact_ids = array())
{
$sum = null;
foreach ($artifact->getLinkedArtifacts($user) as $linked_artifact) {
$value = $this->getUniqueFieldValue($user, $linked_artifact, $timestamp, $computed_artifact_ids);
$sum = $this->sumIfNotNull($sum, $value);
}
return $sum;
}
示例3: isParentLinkedToParentMilestone
private function isParentLinkedToParentMilestone(Tracker_Artifact $artifact_added, Tracker_Artifact $parent_milestone_artifact, PFUser $user)
{
$parent = $artifact_added->getParent($user);
if (!$parent) {
return false;
}
$linked_artifacts = $parent_milestone_artifact->getLinkedArtifacts($user);
foreach ($linked_artifacts as $linked_artifact) {
if ($linked_artifact->getId() === $parent->getId()) {
return true;
}
}
return false;
}
示例4: getLinkedArtifacts
/**
* Returns linked artifacts
*
* @param Tracker_Artifact $artifact
*
* @return Array of Tracker_Artifact
*
* @throws Exception
*/
private function getLinkedArtifacts(Tracker_Artifact $artifact, User $user)
{
$linked_artifacts = $artifact->getLinkedArtifacts($user);
if (count($linked_artifacts)) {
return $linked_artifacts;
}
throw new Tracker_FormElement_Field_BurndownException('burndown_no_linked_artifacts');
}
示例5: getLinkedArtifacts
/**
* Returns linked artifacts
*
* @param Tracker_Artifact $artifact
*
* @return Array of Tracker_Artifact
*
* @throws Tracker_FormElement_Field_BurndownException
*/
private function getLinkedArtifacts(Tracker_Artifact $artifact, PFUser $user)
{
$linked_artifacts = $artifact->getLinkedArtifacts($user);
if (count($linked_artifacts)) {
return $linked_artifacts;
}
throw new Tracker_FormElement_Field_BurndownException($GLOBALS['Language']->getText('plugin_tracker', 'burndown_no_linked_artifacts'));
}