本文整理汇总了PHP中DifferentialRevision::getDateModified方法的典型用法代码示例。如果您正苦于以下问题:PHP DifferentialRevision::getDateModified方法的具体用法?PHP DifferentialRevision::getDateModified怎么用?PHP DifferentialRevision::getDateModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DifferentialRevision
的用法示例。
在下文中一共展示了DifferentialRevision::getDateModified方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexRevision
public static function indexRevision(DifferentialRevision $rev)
{
$doc = new PhabricatorSearchAbstractDocument();
$doc->setPHID($rev->getPHID());
$doc->setDocumentType(PhabricatorPHIDConstants::PHID_TYPE_DREV);
$doc->setDocumentTitle($rev->getTitle());
$doc->setDocumentCreated($rev->getDateCreated());
$doc->setDocumentModified($rev->getDateModified());
$doc->addField(PhabricatorSearchField::FIELD_BODY, $rev->getSummary());
$doc->addField(PhabricatorSearchField::FIELD_TEST_PLAN, $rev->getTestPlan());
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, $rev->getAuthorPHID(), PhabricatorPHIDConstants::PHID_TYPE_USER, $rev->getDateCreated());
if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::CLOSED && $rev->getStatus() != ArcanistDifferentialRevisionStatus::ABANDONED) {
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_OPEN, $rev->getPHID(), PhabricatorPHIDConstants::PHID_TYPE_DREV, time());
}
$comments = id(new DifferentialComment())->loadAllWhere('revisionID = %d', $rev->getID());
$inlines = id(new DifferentialInlineComment())->loadAllWhere('revisionID = %d AND commentID IS NOT NULL', $rev->getID());
$touches = array();
foreach (array_merge($comments, $inlines) as $comment) {
if (strlen($comment->getContent())) {
$doc->addField(PhabricatorSearchField::FIELD_COMMENT, $comment->getContent());
}
$author = $comment->getAuthorPHID();
$touches[$author] = $comment->getDateCreated();
}
foreach ($touches as $touch => $time) {
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_TOUCH, $touch, PhabricatorPHIDConstants::PHID_TYPE_USER, $time);
}
$rev->loadRelationships();
// If a revision needs review, the owners are the reviewers. Otherwise, the
// owner is the author (e.g., accepted, rejected, closed).
if ($rev->getStatus() == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) {
foreach ($rev->getReviewers() as $phid) {
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_OWNER, $phid, PhabricatorPHIDConstants::PHID_TYPE_USER, $rev->getDateModified());
// Bogus timestamp.
}
} else {
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_OWNER, $rev->getAuthorPHID(), PhabricatorPHIDConstants::PHID_TYPE_USER, $rev->getDateCreated());
}
$ccphids = $rev->getCCPHIDs();
$handles = id(new PhabricatorObjectHandleData($ccphids))->loadHandles();
foreach ($handles as $phid => $handle) {
$doc->addRelationship(PhabricatorSearchRelationship::RELATIONSHIP_SUBSCRIBER, $phid, $handle->getType(), $rev->getDateModified());
// Bogus timestamp.
}
self::reindexAbstractDocument($doc);
}
示例2: renderRevisionTooltip
private function renderRevisionTooltip(DifferentialRevision $revision, $handles)
{
$viewer = $this->getRequest()->getUser();
$date = phabricator_date($revision->getDateModified(), $viewer);
$id = $revision->getID();
$title = $revision->getTitle();
$header = "D{$id} {$title}";
$author = $handles[$revision->getAuthorPHID()]->getName();
return "{$header}\n{$date} · {$author}";
}
示例3: renderValueForRevisionList
public function renderValueForRevisionList(DifferentialRevision $revision)
{
return phabricator_datetime($revision->getDateModified(), $this->getUser());
}