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


PHP Issue::getProject方法代码示例

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


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

示例1: findIssues

 public static function findIssues($filters = array(), $results_per_page = 30, $offset = 0, $groupby = null, $grouporder = null, $sortfields = array(tables\Issues::LAST_UPDATED => 'asc'))
 {
     $issues = array();
     list($rows, $count, $ids) = tables\Issues::getTable()->findIssues($filters, $results_per_page, $offset, $groupby, $grouporder, $sortfields);
     if ($rows) {
         if (framework\Context::isProjectContext()) {
             framework\Context::getCurrentProject()->preloadValues();
         }
         tables\IssueCustomFields::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsBuild::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsEdition::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsComponent::getTable()->preloadValuesByIssueIDs($ids);
         tables\Comments::getTable()->preloadIssueCommentCounts($ids);
         tables\IssueFiles::getTable()->preloadIssueFileCounts($ids);
         $user_ids = array();
         foreach ($rows as $key => $row) {
             try {
                 $issue = new Issue($row->get(tables\Issues::ID), $row);
                 $user_ids[$row['issues.posted_by']] = true;
                 $issues[] = $issue;
                 unset($rows[$key]);
             } catch (\Exception $e) {
             }
         }
         if (count($user_ids)) {
             tables\Users::getTable()->preloadUsers(array_keys($user_ids));
         }
         foreach ($issues as $key => $issue) {
             if (!$issue->hasAccess() || $issue->getProject()->isDeleted()) {
                 unset($issues[$key]);
             }
         }
         tables\IssueCustomFields::getTable()->clearPreloadedValues();
         tables\IssueAffectsBuild::getTable()->clearPreloadedValues();
         tables\IssueAffectsEdition::getTable()->clearPreloadedValues();
         tables\IssueAffectsComponent::getTable()->clearPreloadedValues();
         tables\Comments::getTable()->clearPreloadedIssueCommentCounts();
         tables\IssueFiles::getTable()->clearPreloadedIssueFileCounts();
     }
     return array($issues, $count);
 }
开发者ID:AzerothShard,项目名称:thebuggenie,代码行数:41,代码来源:Issue.php

示例2: componentBulkWorkflow

 public function componentBulkWorkflow()
 {
     $workflow_items = array();
     $project = null;
     $issues = array();
     $first = true;
     foreach ($this->issue_ids as $issue_id) {
         $issue = new entities\Issue($issue_id);
         $issues[$issue_id] = $issue;
         if ($first) {
             $workflow_items = $issue->getAvailableWorkflowTransitions();
             $project = $issue->getProject();
             $first = false;
         } else {
             $transitions = $issue->getAvailableWorkflowTransitions();
             foreach ($workflow_items as $transition_id => $transition) {
                 if (!array_key_exists($transition_id, $transitions)) {
                     unset($workflow_items[$transition_id]);
                 }
             }
             if ($issue->getProject()->getID() != $project->getID()) {
                 $project = null;
                 break;
             }
         }
         if (!count($workflow_items)) {
             break;
         }
     }
     $this->issues = $issues;
     $this->project = $project;
     $this->available_transitions = $workflow_items;
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:33,代码来源:Components.php

示例3: convertFancyStringToTime

 /**
  * Turns a string into a months/weeks/days/hours/minutes/points array
  *
  * @param string $string The string to convert
  * @param Issue $issue
  *
  * @return array
  */
 public static function convertFancyStringToTime($string, self $issue)
 {
     $retarr = common\Timeable::getZeroedUnitsWithPoints();
     $string = mb_strtolower(trim($string));
     $time_arr = preg_split('/(\\,|\\/|and|or|plus)/', $string);
     foreach ($time_arr as $time_elm) {
         $time_parts = explode(' ', trim($time_elm));
         if (is_array($time_parts) && count($time_parts) > 1) {
             switch (true) {
                 case mb_stristr($time_parts[1], 'month'):
                     if ($issue->getProject()->hasTimeUnit('months')) {
                         $retarr['months'] = (int) trim($time_parts[0]);
                     }
                     break;
                 case mb_stristr($time_parts[1], 'week'):
                     if ($issue->getProject()->hasTimeUnit('weeks')) {
                         $retarr['weeks'] = (int) trim($time_parts[0]);
                     }
                     break;
                 case mb_stristr($time_parts[1], 'day'):
                     if ($issue->getProject()->hasTimeUnit('days')) {
                         $retarr['days'] = (int) trim($time_parts[0]);
                     }
                     break;
                 case mb_stristr($time_parts[1], 'hour'):
                     if ($issue->getProject()->hasTimeUnit('hours')) {
                         $retarr['hours'] = trim($time_parts[0]);
                     }
                     break;
                 case mb_stristr($time_parts[1], 'minute'):
                     if ($issue->getProject()->hasTimeUnit('minutes')) {
                         $retarr['minutes'] = trim($time_parts[0]);
                     }
                     break;
                 case mb_stristr($time_parts[1], 'point'):
                     $retarr['points'] = (int) trim($time_parts[0]);
                     break;
             }
         }
     }
     return $retarr;
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:50,代码来源:Issue.php


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