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


PHP PhabricatorRepositoryCommit::getRepositoryID方法代码示例

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


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

示例1: indexCommit

 public static function indexCommit(PhabricatorRepositoryCommit $commit)
 {
     $commit_data = id(new PhabricatorRepositoryCommitData())->loadOneWhere('commitID = %d', $commit->getID());
     $date_created = $commit->getEpoch();
     $commit_message = $commit_data->getCommitMessage();
     $author_phid = $commit_data->getCommitDetail('authorPHID');
     $repository = id(new PhabricatorRepository())->loadOneWhere('id = %d', $commit->getRepositoryID());
     if (!$repository) {
         return;
     }
     $title = 'r' . $repository->getCallsign() . $commit->getCommitIdentifier() . " " . $commit_data->getSummary();
     $doc = new PhabricatorSearchAbstractDocument();
     $doc->setPHID($commit->getPHID());
     $doc->setDocumentType(PhabricatorPHIDConstants::PHID_TYPE_CMIT);
     $doc->setDocumentCreated($date_created);
     $doc->setDocumentModified($date_created);
     $doc->setDocumentTitle($title);
     $doc->addField(PhabricatorSearchField::FIELD_BODY, $commit_message);
     if ($author_phid) {
         $doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, $author_phid, PhabricatorPHIDConstants::PHID_TYPE_USER, $date_created);
     }
     $doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_REPOSITORY, $repository->getPHID(), PhabricatorPHIDConstants::PHID_TYPE_REPO, $date_created);
     $comments = id(new PhabricatorAuditComment())->loadAllWhere('targetPHID = %s', $commit->getPHID());
     foreach ($comments as $comment) {
         if (strlen($comment->getContent())) {
             $doc->addField(PhabricatorSearchField::FIELD_COMMENT, $comment->getContent());
         }
     }
     self::reindexAbstractDocument($doc);
 }
开发者ID:nexeck,项目名称:phabricator,代码行数:30,代码来源:PhabricatorSearchCommitIndexer.php

示例2: setCommit

 public function setCommit(PhabricatorRepositoryCommit $commit)
 {
     $viewer = PhabricatorUser::getOmnipotentUser();
     $repository = id(new PhabricatorRepositoryQuery())->setViewer($viewer)->withIDs(array($commit->getRepositoryID()))->needProjectPHIDs(true)->executeOne();
     if (!$repository) {
         throw new Exception(pht('Unable to load repository!'));
     }
     $data = id(new PhabricatorRepositoryCommitData())->loadOneWhere('commitID = %d', $commit->getID());
     if (!$data) {
         throw new Exception(pht('Unable to load commit data!'));
     }
     $this->commit = clone $commit;
     $this->commit->attachRepository($repository);
     $this->commit->attachCommitData($data);
     $this->repository = $repository;
     $this->commitData = $data;
     return $this;
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:18,代码来源:HeraldCommitAdapter.php


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