mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-26 14:38:19 +01:00
0ceab7d36f
Summary: Ref T10967. Improves some method names: - `Revision->getReviewerStatus()` -> `Revision->getReviewers()` - `Revision->attachReviewerStatus()` -> `Revision->attachReviewers()` - `Reviewer->getStatus()` -> `Reviewer->getReviewerStatus()` (this is mostly to make this more greppable) Test Plan: - bunch o' `grep` - Browsed around. - If I missed anything, it should fatal in an obvious way. We have a lot of other `getStatus()` calls and it's hard to be sure I got them all. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17522
45 lines
1.2 KiB
PHP
45 lines
1.2 KiB
PHP
<?php
|
|
|
|
final class DifferentialReviewer
|
|
extends DifferentialDAO {
|
|
|
|
protected $revisionPHID;
|
|
protected $reviewerPHID;
|
|
protected $reviewerStatus;
|
|
protected $lastActionDiffPHID;
|
|
protected $lastCommentDiffPHID;
|
|
|
|
private $authority = array();
|
|
|
|
protected function getConfiguration() {
|
|
return array(
|
|
self::CONFIG_COLUMN_SCHEMA => array(
|
|
'reviewerStatus' => 'text64',
|
|
'lastActionDiffPHID' => 'phid?',
|
|
'lastCommentDiffPHID' => 'phid?',
|
|
),
|
|
self::CONFIG_KEY_SCHEMA => array(
|
|
'key_revision' => array(
|
|
'columns' => array('revisionPHID', 'reviewerPHID'),
|
|
'unique' => true,
|
|
),
|
|
),
|
|
) + parent::getConfiguration();
|
|
}
|
|
|
|
public function isUser() {
|
|
$user_type = PhabricatorPeopleUserPHIDType::TYPECONST;
|
|
return (phid_get_type($this->getReviewerPHID()) == $user_type);
|
|
}
|
|
|
|
public function attachAuthority(PhabricatorUser $user, $has_authority) {
|
|
$this->authority[$user->getCacheFragment()] = $has_authority;
|
|
return $this;
|
|
}
|
|
|
|
public function hasAuthority(PhabricatorUser $viewer) {
|
|
$cache_fragment = $viewer->getCacheFragment();
|
|
return $this->assertAttachedKey($this->authority, $cache_fragment);
|
|
}
|
|
|
|
}
|