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


PHP PhabricatorLiskDAO::getID方法代码示例

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


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

示例1: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $title = $object->getTitle();
     $original_title = $object->getOriginalTitle();
     return id(new PhabricatorMetaMTAMail())->setSubject("Q{$id}: {$title}")->addHeader('Thread-Topic', "Q{$id}: {$original_title}");
 }
开发者ID:denghp,项目名称:phabricator,代码行数:7,代码来源:PonderEditor.php

示例2: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $name = $object->getName();
     return id(new PhabricatorMetaMTAMail())->setSubject("U{$id}: {$name}")->addHeader('Thread-Topic', "U{$id}: " . $object->getName());
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:6,代码来源:PhabricatorPhurlURLEditor.php

示例3: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $name = $object->getName();
     $id = $object->getID();
     $name = pht('Badge %d', $id);
     return id(new PhabricatorMetaMTAMail())->setSubject($name)->addHeader('Thread-Topic', $name);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:7,代码来源:PhabricatorBadgesEditor.php

示例4: buildMailBody

 protected function buildMailBody(PhabricatorLiskDAO $object, array $xactions)
 {
     $body = new PhabricatorMetaMTAMailBody();
     $headers = array();
     $comments = array();
     $inline_comments = array();
     foreach ($xactions as $xaction) {
         if ($xaction->shouldHide()) {
             continue;
         }
         $comment = $xaction->getComment();
         switch ($xaction->getTransactionType()) {
             case PholioTransactionType::TYPE_INLINE:
                 if ($comment && strlen($comment->getContent())) {
                     $inline_comments[] = $comment;
                 }
                 break;
             case PhabricatorTransactions::TYPE_COMMENT:
                 if ($comment && strlen($comment->getContent())) {
                     $comments[] = $comment->getContent();
                 }
                 // fallthrough
             // fallthrough
             default:
                 $headers[] = id(clone $xaction)->setRenderingTarget('text')->getTitle();
                 break;
         }
     }
     $body->addRawSection(implode("\n", $headers));
     foreach ($comments as $comment) {
         $body->addRawSection($comment);
     }
     if ($inline_comments) {
         $body->addRawSection(pht('INLINE COMMENTS'));
         foreach ($inline_comments as $comment) {
             $text = pht('Image %d: %s', $comment->getImageID(), $comment->getContent());
             $body->addRawSection($text);
         }
     }
     $body->addTextSection(pht('MOCK DETAIL'), PhabricatorEnv::getProductionURI('/M' . $object->getID()));
     return $body;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:42,代码来源:PholioMockEditor.php

示例5: willPublish

 protected function willPublish(PhabricatorLiskDAO $object, array $xactions)
 {
     // Reload to pick up the active diff and reviewer status.
     return id(new DifferentialRevisionQuery())->setViewer($this->getActor())->needReviewerStatus(true)->needActiveDiffs(true)->withIDs(array($object->getID()))->executeOne();
 }
开发者ID:kristain,项目名称:phabricator,代码行数:5,代码来源:DifferentialTransactionEditor.php

示例6: applyFinalEffects

 protected function applyFinalEffects(PhabricatorLiskDAO $object, array $xactions)
 {
     // Load auditors explicitly; we may not have them if the caller was a
     // generic piece of infrastructure.
     $commit = id(new DiffusionCommitQuery())->setViewer($this->requireActor())->withIDs(array($object->getID()))->needAuditRequests(true)->executeOne();
     if (!$commit) {
         throw new Exception(pht('Failed to load commit during transaction finalization!'));
     }
     $object->attachAudits($commit->getAudits());
     $status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
     $status_closed = PhabricatorAuditStatusConstants::CLOSED;
     $status_resigned = PhabricatorAuditStatusConstants::RESIGNED;
     $status_accepted = PhabricatorAuditStatusConstants::ACCEPTED;
     $status_concerned = PhabricatorAuditStatusConstants::CONCERNED;
     $actor_phid = $this->getActingAsPHID();
     $actor_is_author = $object->getAuthorPHID() && $actor_phid == $object->getAuthorPHID();
     foreach ($xactions as $xaction) {
         switch ($xaction->getTransactionType()) {
             case PhabricatorAuditActionConstants::ACTION:
                 $new = $xaction->getNewValue();
                 switch ($new) {
                     case PhabricatorAuditActionConstants::CLOSE:
                         // "Close" means wipe out all the concerns.
                         $requests = $object->getAudits();
                         foreach ($requests as $request) {
                             if ($request->getAuditStatus() == $status_concerned) {
                                 $request->setAuditStatus($status_closed)->save();
                             }
                         }
                         break;
                     case PhabricatorAuditActionConstants::RESIGN:
                         $requests = $object->getAudits();
                         $requests = mpull($requests, null, 'getAuditorPHID');
                         $actor_request = idx($requests, $actor_phid);
                         // If the actor doesn't currently have a relationship to the
                         // commit, add one explicitly. For example, this allows members
                         // of a project to resign from a commit and have it drop out of
                         // their queue.
                         if (!$actor_request) {
                             $actor_request = id(new PhabricatorRepositoryAuditRequest())->setCommitPHID($object->getPHID())->setAuditorPHID($actor_phid);
                             $requests[] = $actor_request;
                             $object->attachAudits($requests);
                         }
                         $actor_request->setAuditStatus($status_resigned)->save();
                         break;
                     case PhabricatorAuditActionConstants::ACCEPT:
                     case PhabricatorAuditActionConstants::CONCERN:
                         if ($new == PhabricatorAuditActionConstants::ACCEPT) {
                             $new_status = $status_accepted;
                         } else {
                             $new_status = $status_concerned;
                         }
                         $requests = $object->getAudits();
                         $requests = mpull($requests, null, 'getAuditorPHID');
                         // Figure out which requests the actor has authority over: these
                         // are user requests where they are the auditor, and packages
                         // and projects they are a member of.
                         if ($actor_is_author) {
                             // When modifying your own commits, you act only on behalf of
                             // yourself, not your packages/projects -- the idea being that
                             // you can't accept your own commits.
                             $authority_phids = array($actor_phid);
                         } else {
                             $authority_phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($this->requireActor());
                         }
                         $authority = array_select_keys($requests, $authority_phids);
                         if (!$authority) {
                             // If the actor has no authority over any existing requests,
                             // create a new request for them.
                             $actor_request = id(new PhabricatorRepositoryAuditRequest())->setCommitPHID($object->getPHID())->setAuditorPHID($actor_phid)->setAuditStatus($new_status)->save();
                             $requests[$actor_phid] = $actor_request;
                             $object->attachAudits($requests);
                         } else {
                             // Otherwise, update the audit status of the existing requests.
                             foreach ($authority as $request) {
                                 $request->setAuditStatus($new_status)->save();
                             }
                         }
                         break;
                 }
                 break;
         }
     }
     $requests = $object->getAudits();
     $object->updateAuditStatus($requests);
     $object->save();
     return $xactions;
 }
开发者ID:denghp,项目名称:phabricator,代码行数:88,代码来源:PhabricatorAuditEditor.php

示例7: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     return id(new PhabricatorMetaMTAMail())->setSubject("ANSR{$id}")->addHeader('Thread-Topic', "ANSR{$id}");
 }
开发者ID:nilsdornblut,项目名称:phabricator,代码行数:5,代码来源:PonderAnswerEditor.php

示例8: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $title = $object->getTitle();
     if (!$title) {
         $title = pht('%s sent you a message.', $this->getActor()->getUserName());
     }
     $phid = $object->getPHID();
     return id(new PhabricatorMetaMTAMail())->setSubject("Z{$id}: {$title}")->addHeader('Thread-Topic', "Z{$id}: {$phid}");
 }
开发者ID:patelhardik,项目名称:phabricator,代码行数:10,代码来源:ConpherenceEditor.php

示例9: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $phid = $object->getPHID();
     $title = $object->getDocumentBody()->getTitle();
     return id(new PhabricatorMetaMTAMail())->setSubject("L{$id}: {$title}")->addHeader('Thread-Topic', "L{$id}: {$phid}");
 }
开发者ID:hrb518,项目名称:phabricator,代码行数:7,代码来源:LegalpadDocumentEditor.php

示例10: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $name = $object->getName();
     $phid = $object->getPHID();
     $mail = id(new PhabricatorMetaMTAMail())->setSubject(pht('SSH Key %d: %s', $id, $name))->addHeader('Thread-Topic', $phid);
     // The primary value of this mail is alerting users to account compromises,
     // so force delivery. In particular, this mail should still be delievered
     // even if "self mail" is disabled.
     $mail->setForceDelivery(true);
     return $mail;
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:12,代码来源:PhabricatorAuthSSHKeyEditor.php

示例11: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $phid = $object->getPHID();
     $title = $object->getSummaryForDisplay();
     return id(new PhabricatorMetaMTAMail())->setSubject("RQ{$id}: {$title}")->addHeader('Thread-Topic', "RQ{$id}: {$phid}");
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:7,代码来源:ReleephRequestTransactionalEditor.php

示例12: willPublish

 protected function willPublish(PhabricatorLiskDAO $object, array $xactions)
 {
     // We need the purchases in order to build mail.
     return id(new PhortuneCartQuery())->setViewer($this->getActor())->withIDs(array($object->getID()))->needPurchases(true)->executeOne();
 }
开发者ID:pugong,项目名称:phabricator,代码行数:5,代码来源:PhortuneCartEditor.php

示例13: applyFinalEffects

 protected function applyFinalEffects(PhabricatorLiskDAO $object, array $xactions)
 {
     // If the repository does not have a local path yet, assign it one based
     // on its ID. We can't do this earlier because we won't have an ID yet.
     $local_path = $object->getDetail('local-path');
     if (!strlen($local_path)) {
         $local_key = 'repository.default-local-path';
         $local_root = PhabricatorEnv::getEnvConfig($local_key);
         $local_root = rtrim($local_root, '/');
         $id = $object->getID();
         $local_path = "{$local_root}/{$id}/";
         $object->setDetail('local-path', $local_path);
         $object->save();
     }
     return $xactions;
 }
开发者ID:Houzz,项目名称:phabricator,代码行数:16,代码来源:PhabricatorRepositoryEditor.php

示例14: willPublish

 protected function willPublish(PhabricatorLiskDAO $object, array $xactions)
 {
     return id(new DiffusionCommitQuery())->setViewer($this->requireActor())->withIDs(array($object->getID()))->needAuditRequests(true)->needCommitData(true)->executeOne();
 }
开发者ID:shrimpma,项目名称:phabricator,代码行数:4,代码来源:PhabricatorAuditEditor.php

示例15: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $id = $object->getID();
     $title = $object->getContent()->getTitle();
     return id(new PhabricatorMetaMTAMail())->setSubject($title)->addHeader('Thread-Topic', $object->getPHID());
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:6,代码来源:PhrictionTransactionEditor.php


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