本文整理汇总了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}");
}
示例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());
}
示例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);
}
示例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;
}
示例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();
}
示例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;
}
示例7: buildMailTemplate
protected function buildMailTemplate(PhabricatorLiskDAO $object)
{
$id = $object->getID();
return id(new PhabricatorMetaMTAMail())->setSubject("ANSR{$id}")->addHeader('Thread-Topic', "ANSR{$id}");
}
示例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}");
}
示例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}");
}
示例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;
}
示例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}");
}
示例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();
}
示例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;
}
示例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();
}
示例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());
}