1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-01 18:30:59 +01:00

Move PhabricatorUser to new phid stuff

Summary: Ref T2715. Had to start loading status information in the query class. Debated trying to clean up some of the attach / load stuff but decided to just add status under the new paradigm for now.

Test Plan: phid.query  also made a status and checked that out. also played in conpherence.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2715

Differential Revision: https://secure.phabricator.com/D6585
This commit is contained in:
Bob Trahan 2013-07-26 14:05:19 -07:00
parent 1457797c4a
commit 1cb0db8755
25 changed files with 116 additions and 90 deletions

View file

@ -1375,6 +1375,7 @@ phutil_register_library_map(array(
'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php', 'PhabricatorPeopleListController' => 'applications/people/controller/PhabricatorPeopleListController.php',
'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php', 'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php',
'PhabricatorPeoplePHIDTypeExternal' => 'applications/people/phid/PhabricatorPeoplePHIDTypeExternal.php', 'PhabricatorPeoplePHIDTypeExternal' => 'applications/people/phid/PhabricatorPeoplePHIDTypeExternal.php',
'PhabricatorPeoplePHIDTypeUser' => 'applications/people/phid/PhabricatorPeoplePHIDTypeUser.php',
'PhabricatorPeopleProfileController' => 'applications/people/controller/PhabricatorPeopleProfileController.php', 'PhabricatorPeopleProfileController' => 'applications/people/controller/PhabricatorPeopleProfileController.php',
'PhabricatorPeopleProfileEditController' => 'applications/people/controller/PhabricatorPeopleProfileEditController.php', 'PhabricatorPeopleProfileEditController' => 'applications/people/controller/PhabricatorPeopleProfileEditController.php',
'PhabricatorPeopleProfilePictureController' => 'applications/people/controller/PhabricatorPeopleProfilePictureController.php', 'PhabricatorPeopleProfilePictureController' => 'applications/people/controller/PhabricatorPeopleProfilePictureController.php',
@ -3410,6 +3411,7 @@ phutil_register_library_map(array(
), ),
'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController', 'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController',
'PhabricatorPeoplePHIDTypeExternal' => 'PhabricatorPHIDType', 'PhabricatorPeoplePHIDTypeExternal' => 'PhabricatorPHIDType',
'PhabricatorPeoplePHIDTypeUser' => 'PhabricatorPHIDType',
'PhabricatorPeopleProfileController' => 'PhabricatorPeopleController', 'PhabricatorPeopleProfileController' => 'PhabricatorPeopleController',
'PhabricatorPeopleProfileEditController' => 'PhabricatorPeopleController', 'PhabricatorPeopleProfileEditController' => 'PhabricatorPeopleController',
'PhabricatorPeopleProfilePictureController' => 'PhabricatorPeopleController', 'PhabricatorPeopleProfilePictureController' => 'PhabricatorPeopleController',

View file

@ -219,7 +219,7 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
case 'active': case 'active':
case 'user': case 'user':
case 'author': case 'author':
if ($type !== PhabricatorPHIDConstants::PHID_TYPE_USER) { if ($type !== PhabricatorPeoplePHIDTypeUser::TYPECONST) {
throw new Exception("PHID must be a user PHID!"); throw new Exception("PHID must be a user PHID!");
} }
break; break;

View file

@ -142,7 +142,7 @@ abstract class DifferentialMail extends PhabricatorMail {
continue; continue;
} }
$type = $reason_handles[$relation['reasonPHID']]->getType(); $type = $reason_handles[$relation['reasonPHID']]->getType();
if ($type == PhabricatorPHIDConstants::PHID_TYPE_USER) { if ($type == PhabricatorPeoplePHIDTypeUser::TYPECONST) {
$explicit_cc[] = $relation['objectPHID']; $explicit_cc[] = $relation['objectPHID'];
} }
} }

View file

@ -41,7 +41,7 @@ final class DifferentialSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$rev->getAuthorPHID(), $rev->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$rev->getDateCreated()); $rev->getDateCreated());
if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::CLOSED && if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::CLOSED &&
@ -79,7 +79,7 @@ final class DifferentialSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_TOUCH, PhabricatorSearchRelationship::RELATIONSHIP_TOUCH,
$touch, $touch,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$time); $time);
} }
@ -92,14 +92,14 @@ final class DifferentialSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER, PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
$phid, $phid,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$rev->getDateModified()); // Bogus timestamp. $rev->getDateModified()); // Bogus timestamp.
} }
} else { } else {
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER, PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
$rev->getAuthorPHID(), $rev->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$rev->getDateCreated()); $rev->getDateCreated());
} }

View file

@ -105,7 +105,7 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod {
$owner_phid = $request->getValue('ownerPHID'); $owner_phid = $request->getValue('ownerPHID');
if ($owner_phid !== null) { if ($owner_phid !== null) {
$this->validatePHIDList(array($owner_phid), $this->validatePHIDList(array($owner_phid),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
'ownerPHID'); 'ownerPHID');
$changes[ManiphestTransactionType::TYPE_OWNER] = $owner_phid; $changes[ManiphestTransactionType::TYPE_OWNER] = $owner_phid;
} }
@ -113,7 +113,7 @@ abstract class ConduitAPI_maniphest_Method extends ConduitAPIMethod {
$ccs = $request->getValue('ccPHIDs'); $ccs = $request->getValue('ccPHIDs');
if ($ccs !== null) { if ($ccs !== null) {
$this->validatePHIDList($ccs, $this->validatePHIDList($ccs,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
'ccPHIDS'); 'ccPHIDS');
$changes[ManiphestTransactionType::TYPE_CCS] = $ccs; $changes[ManiphestTransactionType::TYPE_CCS] = $ccs;
} }

View file

@ -27,7 +27,7 @@ final class ManiphestSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$task->getAuthorPHID(), $task->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$task->getDateCreated()); $task->getDateCreated());
if ($task->getStatus() == ManiphestTaskStatus::STATUS_OPEN) { if ($task->getStatus() == ManiphestTaskStatus::STATUS_OPEN) {
@ -88,7 +88,7 @@ final class ManiphestSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER, PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
$owner->getNewValue(), $owner->getNewValue(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$owner->getDateCreated()); $owner->getDateCreated());
} else { } else {
$doc->addRelationship( $doc->addRelationship(
@ -104,7 +104,7 @@ final class ManiphestSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_TOUCH, PhabricatorSearchRelationship::RELATIONSHIP_TOUCH,
$touch, $touch,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$time); $time);
} }

View file

@ -33,7 +33,7 @@ final class PhabricatorMetaMTAActorQuery extends PhabricatorQuery {
foreach ($type_map as $type => $phids) { foreach ($type_map as $type => $phids) {
switch ($type) { switch ($type) {
case PhabricatorPHIDConstants::PHID_TYPE_USER: case PhabricatorPeoplePHIDTypeUser::TYPECONST:
$this->loadUserActors($actors, $phids); $this->loadUserActors($actors, $phids);
break; break;
case PhabricatorPeoplePHIDTypeExternal::TYPECONST: case PhabricatorPeoplePHIDTypeExternal::TYPECONST:

View file

@ -280,7 +280,7 @@ EOBODY;
PhabricatorObjectHandle $handle, PhabricatorObjectHandle $handle,
$prefix) { $prefix) {
if ($handle->getType() != PhabricatorPHIDConstants::PHID_TYPE_USER) { if ($handle->getType() != PhabricatorPeoplePHIDTypeUser::TYPECONST) {
// You must be a real user to get a private reply handler address. // You must be a real user to get a private reply handler address.
return null; return null;
} }

View file

@ -44,7 +44,7 @@ final class ConduitAPI_owners_query_Method
protected static function queryByOwner($owner) { protected static function queryByOwner($owner) {
$is_valid_phid = $is_valid_phid =
phid_get_type($owner) == PhabricatorPHIDConstants::PHID_TYPE_USER || phid_get_type($owner) == PhabricatorPeoplePHIDTypeUser::TYPECONST ||
phid_get_type($owner) == PhabricatorProjectPHIDTypeProject::TYPECONST; phid_get_type($owner) == PhabricatorProjectPHIDTypeProject::TYPECONST;
if (!$is_valid_phid) { if (!$is_valid_phid) {

View file

@ -38,7 +38,7 @@ final class PhabricatorOwnersOwner extends PhabricatorOwnersDAO {
$all_phids = phid_group_by_type(mpull($owners, 'getUserPHID')); $all_phids = phid_group_by_type(mpull($owners, 'getUserPHID'));
$user_phids = idx($all_phids, $user_phids = idx($all_phids,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
array()); array());
$users_in_project_phids = array(); $users_in_project_phids = array();

View file

@ -0,0 +1,52 @@
<?php
final class PhabricatorPeoplePHIDTypeUser extends PhabricatorPHIDType {
const TYPECONST = 'USER';
public function getTypeConstant() {
return self::TYPECONST;
}
public function getTypeName() {
return pht('Phabricator User');
}
public function newObject() {
return new PhabricatorUser();
}
public function loadObjects(
PhabricatorObjectQuery $query,
array $phids) {
return id(new PhabricatorPeopleQuery())
->needProfileImage(true)
->needStatus(true)
->setViewer($query->getViewer())
->withPHIDs($phids)
->execute();
}
public function loadHandles(
PhabricatorHandleQuery $query,
array $handles,
array $objects) {
foreach ($handles as $phid => $handle) {
$user = $objects[$phid];
$handle->setName($user->getUsername());
$handle->setURI('/p/'.$user->getUsername().'/');
$handle->setFullName(
$user->getUsername().' ('.$user->getRealName().')');
$handle->setImageURI($user->loadProfileImageURI());
if ($user->hasStatus()) {
$status = $user->getStatus();
$handle->setStatus($status->getTextStatus());
$handle->setTitle($status->getTerseSummary($query->getViewer()));
}
}
}
}

View file

@ -18,6 +18,7 @@ final class PhabricatorPeopleQuery
private $needPrimaryEmail; private $needPrimaryEmail;
private $needProfile; private $needProfile;
private $needProfileImage; private $needProfileImage;
private $needStatus;
public function withIDs(array $ids) { public function withIDs(array $ids) {
$this->ids = $ids; $this->ids = $ids;
@ -89,6 +90,11 @@ final class PhabricatorPeopleQuery
return $this; return $this;
} }
public function needStatus($need) {
$this->needStatus = $need;
return $this;
}
public function loadPage() { public function loadPage() {
$table = new PhabricatorUser(); $table = new PhabricatorUser();
$conn_r = $table->establishConnection('r'); $conn_r = $table->establishConnection('r');
@ -143,6 +149,18 @@ final class PhabricatorPeopleQuery
} }
} }
if ($this->needStatus) {
$user_list = mpull($users, null, 'getPHID');
$statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses(
array_keys($user_list));
foreach ($user_list as $phid => $user) {
$status = idx($statuses, $phid);
if ($status) {
$user->attachStatus($status);
}
}
}
return $users; return $users;
} }

View file

@ -12,7 +12,7 @@ final class PhabricatorUserSearchIndexer
$doc = new PhabricatorSearchAbstractDocument(); $doc = new PhabricatorSearchAbstractDocument();
$doc->setPHID($user->getPHID()); $doc->setPHID($user->getPHID());
$doc->setDocumentType(PhabricatorPHIDConstants::PHID_TYPE_USER); $doc->setDocumentType(PhabricatorPeoplePHIDTypeUser::TYPECONST);
$doc->setDocumentTitle($user->getUserName().' ('.$user->getRealName().')'); $doc->setDocumentTitle($user->getUserName().' ('.$user->getRealName().')');
$doc->setDocumentCreated($user->getDateCreated()); $doc->setDocumentCreated($user->getDateCreated());
$doc->setDocumentModified($user->getDateModified()); $doc->setDocumentModified($user->getDateModified());
@ -24,7 +24,7 @@ final class PhabricatorUserSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OPEN, PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
$user->getPHID(), $user->getPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
time()); time());
} }

View file

@ -32,7 +32,7 @@ final class PhabricatorUser
private $profileImage = null; private $profileImage = null;
private $profile = null; private $profile = null;
private $status = null; private $status = self::ATTACHABLE;
private $preferences = null; private $preferences = null;
private $omnipotent = false; private $omnipotent = false;
private $customFields = array(); private $customFields = array();
@ -65,7 +65,7 @@ final class PhabricatorUser
public function generatePHID() { public function generatePHID() {
return PhabricatorPHID::generateNewPHID( return PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_USER); PhabricatorPeoplePHIDTypeUser::TYPECONST);
} }
public function setPassword(PhutilOpaqueEnvelope $envelope) { public function setPassword(PhutilOpaqueEnvelope $envelope) {
@ -662,6 +662,20 @@ EOBODY;
return celerity_get_resource_uri('/rsrc/image/avatar.png'); return celerity_get_resource_uri('/rsrc/image/avatar.png');
} }
public function attachStatus(PhabricatorUserStatus $status) {
$this->status = $status;
return $this;
}
public function getStatus() {
$this->assertAttached($this->status);
return $this->status;
}
public function hasStatus() {
return $this->status !== self::ATTACHABLE;
}
public function attachProfileImageURI($uri) { public function attachProfileImageURI($uri) {
$this->profileImage = $uri; $this->profileImage = $uri;
return $this; return $this;

View file

@ -8,7 +8,7 @@ final class PhabricatorUserTransaction
} }
public function getApplicationTransactionType() { public function getApplicationTransactionType() {
return PhabricatorPHIDConstants::PHID_TYPE_USER; return PhabricatorPeoplePHIDTypeUser::TYPECONST;
} }
public function getApplicationTransactionCommentObject() { public function getApplicationTransactionCommentObject() {

View file

@ -107,11 +107,7 @@ final class PhabricatorObjectHandle
return $this->getPHIDType()->getTypeName(); return $this->getPHIDType()->getTypeName();
} }
static $map = array( return $this->getType();
PhabricatorPHIDConstants::PHID_TYPE_USER => 'User',
);
return idx($map, $this->getType(), $this->getType());
} }
@ -201,7 +197,7 @@ final class PhabricatorObjectHandle
public function getLinkName() { public function getLinkName() {
switch ($this->getType()) { switch ($this->getType()) {
case PhabricatorPHIDConstants::PHID_TYPE_USER: case PhabricatorPeoplePHIDTypeUser::TYPECONST:
$name = $this->getName(); $name = $this->getName();
break; break;
default: default:

View file

@ -48,14 +48,6 @@ final class PhabricatorObjectHandleData {
switch ($type) { switch ($type) {
case PhabricatorPHIDConstants::PHID_TYPE_USER:
// TODO: Update query + Batch User Images
$user_dao = new PhabricatorUser();
$users = $user_dao->loadAllWhere(
'phid in (%Ls)',
$phids);
return mpull($users, null, 'getPHID');
case PhabricatorPHIDConstants::PHID_TYPE_APRJ: case PhabricatorPHIDConstants::PHID_TYPE_APRJ:
$project_dao = new PhabricatorRepositoryArcanistProject(); $project_dao = new PhabricatorRepositoryArcanistProject();
$projects = $project_dao->loadAllWhere( $projects = $project_dao->loadAllWhere(
@ -145,53 +137,6 @@ final class PhabricatorObjectHandleData {
} }
break; break;
case PhabricatorPHIDConstants::PHID_TYPE_USER:
$image_phids = mpull($objects, 'getProfileImagePHID');
$image_phids = array_unique(array_filter($image_phids));
$images = array();
if ($image_phids) {
$images = id(new PhabricatorFile())->loadAllWhere(
'phid IN (%Ls)',
$image_phids);
$images = mpull($images, 'getBestURI', 'getPHID');
}
$statuses = id(new PhabricatorUserStatus())->loadCurrentStatuses(
$phids);
foreach ($phids as $phid) {
$handle = new PhabricatorObjectHandle();
$handle->setPHID($phid);
$handle->setType($type);
if (empty($objects[$phid])) {
$handle->setName('Unknown User');
} else {
$user = $objects[$phid];
$handle->setName($user->getUsername());
$handle->setURI('/p/'.$user->getUsername().'/');
$handle->setFullName(
$user->getUsername().' ('.$user->getRealName().')');
$handle->setComplete(true);
if (isset($statuses[$phid])) {
$handle->setStatus($statuses[$phid]->getTextStatus());
$handle->setTitle(
$statuses[$phid]->getTerseSummary($this->viewer));
}
$handle->setDisabled($user->getIsDisabled());
$img_uri = idx($images, $user->getProfileImagePHID());
if ($img_uri) {
$handle->setImageURI($img_uri);
} else {
$handle->setImageURI(
PhabricatorUser::getDefaultProfileImageURI());
}
}
$handles[$phid] = $handle;
}
break;
case PhabricatorPHIDConstants::PHID_TYPE_APRJ: case PhabricatorPHIDConstants::PHID_TYPE_APRJ:
foreach ($phids as $phid) { foreach ($phids as $phid) {
$handle = new PhabricatorObjectHandle(); $handle = new PhabricatorObjectHandle();

View file

@ -26,7 +26,7 @@ final class PholioSearchIndexer extends PhabricatorSearchDocumentIndexer {
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$mock->getAuthorPHID(), $mock->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$mock->getDateCreated()); $mock->getDateCreated());
return $doc; return $doc;

View file

@ -34,7 +34,7 @@ final class PhrictionSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$content->getAuthorPHID(), $content->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$content->getDateCreated()); $content->getDateCreated());
if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) { if ($document->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS) {

View file

@ -209,7 +209,7 @@ final class PhabricatorPolicyFilter {
} else { } else {
$this->rejectObject($object, $policy, $capability); $this->rejectObject($object, $policy, $capability);
} }
} else if ($type == PhabricatorPHIDConstants::PHID_TYPE_USER) { } else if ($type == PhabricatorPeoplePHIDTypeUser::TYPECONST) {
if ($viewer->getPHID() == $policy) { if ($viewer->getPHID() == $policy) {
return true; return true;
} else { } else {
@ -271,7 +271,7 @@ final class PhabricatorPolicyFilter {
if ($type == PhabricatorProjectPHIDTypeProject::TYPECONST) { if ($type == PhabricatorProjectPHIDTypeProject::TYPECONST) {
$who = "To {$verb} this object, you must be a member of project ". $who = "To {$verb} this object, you must be a member of project ".
"'".$handle->getFullName()."'."; "'".$handle->getFullName()."'.";
} else if ($type == PhabricatorPHIDConstants::PHID_TYPE_USER) { } else if ($type == PhabricatorPeoplePHIDTypeUser::TYPECONST) {
$who = "Only '".$handle->getFullName()."' can {$verb} this object."; $who = "Only '".$handle->getFullName()."' can {$verb} this object.";
} else { } else {
$who = "It is unclear who can {$verb} this object."; $who = "It is unclear who can {$verb} this object.";

View file

@ -26,7 +26,7 @@ final class PonderSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$question->getAuthorPHID(), $question->getAuthorPHID(),
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$question->getDateCreated()); $question->getDateCreated());
$comments = $question->getComments(); $comments = $question->getComments();

View file

@ -43,7 +43,7 @@ final class PhabricatorRepositoryCommitSearchIndexer
$doc->addRelationship( $doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$author_phid, $author_phid,
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
$date_created); $date_created);
} }

View file

@ -19,7 +19,7 @@ final class PhabricatorSearchAbstractDocument {
PhabricatorRepositoryPHIDTypeCommit::TYPECONST => 'Repository Commits', PhabricatorRepositoryPHIDTypeCommit::TYPECONST => 'Repository Commits',
ManiphestPHIDTypeTask::TYPECONST => 'Maniphest Tasks', ManiphestPHIDTypeTask::TYPECONST => 'Maniphest Tasks',
PhrictionPHIDTypeDocument::TYPECONST => 'Phriction Documents', PhrictionPHIDTypeDocument::TYPECONST => 'Phriction Documents',
PhabricatorPHIDConstants::PHID_TYPE_USER => 'Phabricator Users', PhabricatorPeoplePHIDTypeUser::TYPECONST => 'Phabricator Users',
PonderPHIDTypeQuestion::TYPECONST => 'Ponder Questions', PonderPHIDTypeQuestion::TYPECONST => 'Ponder Questions',
); );
} }

View file

@ -53,7 +53,7 @@ final class PhabricatorHovercardExample extends PhabricatorUIExample {
$user_handle = $this->createBasicDummyHandle( $user_handle = $this->createBasicDummyHandle(
'gwashington', 'gwashington',
PhabricatorPHIDConstants::PHID_TYPE_USER, PhabricatorPeoplePHIDTypeUser::TYPECONST,
'George Washington'); 'George Washington');
$user_handle->setImageURI( $user_handle->setImageURI(
celerity_get_resource_uri('/rsrc/image/people/washington.png')); celerity_get_resource_uri('/rsrc/image/people/washington.png'));

View file

@ -154,7 +154,6 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants {
} }
static $class_map = array( static $class_map = array(
PhabricatorPHIDConstants::PHID_TYPE_USER => 'PhabricatorUser',
PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject', PhabricatorPHIDConstants::PHID_TYPE_TOBJ => 'HarbormasterObject',
PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer', PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer',
PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount', PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount',