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


PHP PhabricatorRepositoryCommit::makeEphemeral方法代码示例

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


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

示例1: loadCommitsByIdentifiers

 protected final function loadCommitsByIdentifiers(array $identifiers)
 {
     if (!$identifiers) {
         return array();
     }
     $commits = array();
     $commit_data = array();
     $drequest = $this->getRequest();
     $repository = $drequest->getRepository();
     $commits = id(new PhabricatorRepositoryCommit())->loadAllWhere('repositoryID = %d AND commitIdentifier IN (%Ls)', $repository->getID(), $identifiers);
     $commits = mpull($commits, null, 'getCommitIdentifier');
     // Build empty commit objects for every commit, so we can show unparsed
     // commits in history views as "unparsed" instead of not showing them. This
     // makes the process of importing and parsing commits much clearer to the
     // user.
     $commit_list = array();
     foreach ($identifiers as $identifier) {
         $commit_obj = idx($commits, $identifier);
         if (!$commit_obj) {
             $commit_obj = new PhabricatorRepositoryCommit();
             $commit_obj->setRepositoryID($repository->getID());
             $commit_obj->setCommitIdentifier($identifier);
             $commit_obj->setIsUnparsed(true);
             $commit_obj->makeEphemeral();
         }
         $commit_list[$identifier] = $commit_obj;
     }
     $commits = $commit_list;
     $commit_ids = array_filter(mpull($commits, 'getID'));
     if ($commit_ids) {
         $commit_data = id(new PhabricatorRepositoryCommitData())->loadAllWhere('commitID in (%Ld)', $commit_ids);
         $commit_data = mpull($commit_data, null, 'getCommitID');
     }
     foreach ($commits as $commit) {
         if (!$commit->getID()) {
             continue;
         }
         if (idx($commit_data, $commit->getID())) {
             $commit->attachCommitData($commit_data[$commit->getID()]);
         }
     }
     return $commits;
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:43,代码来源:DiffusionQuery.php


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