Page MenuHomePhabricator

D9849.id23630.diff
No OneTemporary

D9849.id23630.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1984,6 +1984,8 @@
'PhabricatorProjectCustomFieldStringIndex' => 'applications/project/storage/PhabricatorProjectCustomFieldStringIndex.php',
'PhabricatorProjectDAO' => 'applications/project/storage/PhabricatorProjectDAO.php',
'PhabricatorProjectDescriptionField' => 'applications/project/customfield/PhabricatorProjectDescriptionField.php',
+ 'PhabricatorProjectEdgeTypeObjectHasProject' => 'applications/project/edge/PhabricatorProjectEdgeTypeObjectHasProject.php',
+ 'PhabricatorProjectEdgeTypeProjectHasObject' => 'applications/project/edge/PhabricatorProjectEdgeTypeProjectHasObject.php',
'PhabricatorProjectEditDetailsController' => 'applications/project/controller/PhabricatorProjectEditDetailsController.php',
'PhabricatorProjectEditIconController' => 'applications/project/controller/PhabricatorProjectEditIconController.php',
'PhabricatorProjectEditMainController' => 'applications/project/controller/PhabricatorProjectEditMainController.php',
@@ -4856,6 +4858,8 @@
'PhabricatorProjectCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage',
'PhabricatorProjectDAO' => 'PhabricatorLiskDAO',
'PhabricatorProjectDescriptionField' => 'PhabricatorProjectStandardCustomField',
+ 'PhabricatorProjectEdgeTypeObjectHasProject' => 'PhabricatorEdgeType',
+ 'PhabricatorProjectEdgeTypeProjectHasObject' => 'PhabricatorEdgeType',
'PhabricatorProjectEditDetailsController' => 'PhabricatorProjectController',
'PhabricatorProjectEditIconController' => 'PhabricatorProjectController',
'PhabricatorProjectEditMainController' => 'PhabricatorProjectController',
diff --git a/src/applications/differential/customfield/DifferentialProjectsField.php b/src/applications/differential/customfield/DifferentialProjectsField.php
--- a/src/applications/differential/customfield/DifferentialProjectsField.php
+++ b/src/applications/differential/customfield/DifferentialProjectsField.php
@@ -35,7 +35,7 @@
$projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$revision->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
$projects = array_reverse($projects);
return $projects;
@@ -97,7 +97,9 @@
}
public function getApplicationTransactionMetadata() {
- return array('edge:type' => PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ return array(
+ 'edge:type' => PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST,
+ );
}
public function parseValueFromCommitMessage($value) {
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -164,7 +164,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$view->addProperty(
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
@@ -73,7 +73,7 @@
->setTransactionType($type_edge)
->setMetadataValue(
'edge:type',
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT)
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST)
->setNewValue(
array(
'=' => array_fuse($v_projects),
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
@@ -265,7 +265,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$repository->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
if ($project_phids) {
$this->loadHandles($project_phids);
$project_text = $this->renderHandlesForPHIDs($project_phids);
diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
--- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
@@ -103,7 +103,7 @@
case self::FIELD_PROJECTS:
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getMock()->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
}
return parent::getHeraldField($field);
diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php
--- a/src/applications/paste/controller/PhabricatorPasteEditController.php
+++ b/src/applications/paste/controller/PhabricatorPasteEditController.php
@@ -80,7 +80,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$paste->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -125,7 +125,7 @@
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
->setNewValue($v_policy);
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$xactions[] = id(new PhabricatorPasteTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/pholio/controller/PholioMockEditController.php b/src/applications/pholio/controller/PholioMockEditController.php
--- a/src/applications/pholio/controller/PholioMockEditController.php
+++ b/src/applications/pholio/controller/PholioMockEditController.php
@@ -52,7 +52,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$mock->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -208,7 +208,7 @@
}
if (!$errors) {
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$xactions[] = id(new PholioTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/ponder/controller/PonderQuestionEditController.php b/src/applications/ponder/controller/PonderQuestionEditController.php
--- a/src/applications/ponder/controller/PonderQuestionEditController.php
+++ b/src/applications/ponder/controller/PonderQuestionEditController.php
@@ -27,7 +27,7 @@
}
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$question->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
$v_projects = array_reverse($v_projects);
} else {
$question = id(new PonderQuestion())
@@ -70,7 +70,7 @@
->setTransactionType(PonderQuestionTransaction::TYPE_CONTENT)
->setNewValue($v_content);
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$xactions[] = id(new PonderQuestionTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/project/edge/PhabricatorProjectEdgeTypeObjectHasProject.php b/src/applications/project/edge/PhabricatorProjectEdgeTypeObjectHasProject.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/edge/PhabricatorProjectEdgeTypeObjectHasProject.php
@@ -0,0 +1,106 @@
+<?php
+
+final class PhabricatorProjectEdgeTypeObjectHasProject
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 41;
+
+ public function getEdgeConstant() {
+ return self::EDGECONST;
+ }
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorProjectEdgeTypeProjectHasObject::EDGECONST;
+ }
+
+ public function getTransactionAddString(
+ $actor,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s project(s): %s.',
+ $actor,
+ $add_count,
+ $add_edges);
+ }
+
+ public function getTransactionRemoveString(
+ $actor,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s project(s): %s.',
+ $actor,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getTransactionEditString(
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited %s project(s), added %s: %s; removed %s: %s.',
+ $actor,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+ public function getFeedAddString(
+ $actor,
+ $object,
+ $add_count,
+ $add_edges) {
+
+ return pht(
+ '%s added %s project(s) to %s: %s.',
+ $actor,
+ $add_count,
+ $object,
+ $add_edges);
+ }
+
+ public function getFeedRemoveString(
+ $actor,
+ $object,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s removed %s project(s) from %s: %s.',
+ $actor,
+ $rem_count,
+ $object,
+ $rem_edges);
+ }
+
+ public function getFeedEditString(
+ $actor,
+ $object,
+ $total_count,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges) {
+
+ return pht(
+ '%s edited %s project(s) for %s, added %s: %s; removed %s: %s.',
+ $actor,
+ $total_count,
+ $object,
+ $add_count,
+ $add_edges,
+ $rem_count,
+ $rem_edges);
+ }
+
+}
diff --git a/src/applications/project/edge/PhabricatorProjectEdgeTypeProjectHasObject.php b/src/applications/project/edge/PhabricatorProjectEdgeTypeProjectHasObject.php
new file mode 100644
--- /dev/null
+++ b/src/applications/project/edge/PhabricatorProjectEdgeTypeProjectHasObject.php
@@ -0,0 +1,16 @@
+<?php
+
+final class PhabricatorProjectEdgeTypeProjectHasObject
+ extends PhabricatorEdgeType {
+
+ const EDGECONST = 42;
+
+ public function getEdgeConstant() {
+ return self::EDGECONST;
+ }
+
+ public function getInverseEdgeConstant() {
+ return PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
+ }
+
+}
diff --git a/src/applications/project/events/PhabricatorProjectUIEventListener.php b/src/applications/project/events/PhabricatorProjectUIEventListener.php
--- a/src/applications/project/events/PhabricatorProjectUIEventListener.php
+++ b/src/applications/project/events/PhabricatorProjectUIEventListener.php
@@ -31,7 +31,7 @@
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
if ($project_phids) {
$project_phids = array_reverse($project_phids);
$handles = id(new PhabricatorHandleQuery())
diff --git a/src/applications/repository/query/PhabricatorRepositoryQuery.php b/src/applications/repository/query/PhabricatorRepositoryQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryQuery.php
@@ -208,7 +208,7 @@
public function didFilterPage(array $repositories) {
if ($this->needProjectPHIDs) {
- $type_project = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $type_project = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$edge_query = id(new PhabricatorEdgeQuery())
->withSourcePHIDs(mpull($repositories, 'getPHID'))
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
--- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
@@ -41,7 +41,7 @@
} else {
$v_projects = PhabricatorEdgeQuery::loadDestinationPHIDs(
$poll->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
$v_projects = array_reverse($v_projects);
}
@@ -108,7 +108,7 @@
->setNewValue($v_view_policy);
if (empty($errors)) {
- $proj_edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $proj_edge_type = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$xactions[] = id(new PhabricatorSlowvoteTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
->setMetadataValue('edge:type', $proj_edge_type)
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1153,7 +1153,7 @@
}
if ($phids) {
- $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT;
+ $edge_type = PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST;
$block_xactions[] = newv(get_class(head($xactions)), array())
->setIgnoreOnNoEffect(true)
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
@@ -1967,7 +1967,7 @@
if ($object instanceof PhabricatorProjectInterface) {
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
- PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
+ PhabricatorProjectEdgeTypeObjectHasProject::EDGECONST);
} else {
$project_phids = $object->getProjectPHIDs();
}
diff --git a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
--- a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
+++ b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php
@@ -57,9 +57,6 @@
const TYPE_OBJECT_USES_CREDENTIAL = 39;
const TYPE_CREDENTIAL_USED_BY_OBJECT = 40;
- const TYPE_OBJECT_HAS_PROJECT = 41;
- const TYPE_PROJECT_HAS_OBJECT = 42;
-
const TYPE_OBJECT_HAS_COLUMN = 43;
const TYPE_COLUMN_HAS_OBJECT = 44;
@@ -180,9 +177,6 @@
self::TYPE_OBJECT_USES_CREDENTIAL => self::TYPE_CREDENTIAL_USED_BY_OBJECT,
self::TYPE_CREDENTIAL_USED_BY_OBJECT => self::TYPE_OBJECT_USES_CREDENTIAL,
- self::TYPE_OBJECT_HAS_PROJECT => self::TYPE_PROJECT_HAS_OBJECT,
- self::TYPE_PROJECT_HAS_OBJECT => self::TYPE_OBJECT_HAS_PROJECT,
-
self::TYPE_OBJECT_HAS_COLUMN => self::TYPE_COLUMN_HAS_OBJECT,
self::TYPE_COLUMN_HAS_OBJECT => self::TYPE_OBJECT_HAS_COLUMN,
@@ -263,7 +257,6 @@
return '%s edited member(s), added %d: %s; removed %d: %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s edited project(s), added %d: %s; removed %d: %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -278,7 +271,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
return '%s edited object(s), added %d: %s; removed %d: %s.';
case self::TYPE_OBJECT_HAS_UNSUBSCRIBER:
return '%s edited unsubcriber(s), added %d: %s; removed %d: %s.';
@@ -340,7 +332,6 @@
return '%s added %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s added %d project(s): %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -381,7 +372,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s added %d object(s): %s.';
@@ -415,7 +405,6 @@
return '%s removed %d member(s): %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s removed %d project(s): %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -454,7 +443,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s removed %d object(s): %s.';
@@ -486,7 +474,6 @@
return '%s updated members of %s.';
case self::TYPE_MEMBER_OF_PROJ:
case self::TYPE_COMMIT_HAS_PROJECT:
- case self::TYPE_OBJECT_HAS_PROJECT:
return '%s updated projects of %s.';
case self::TYPE_QUESTION_HAS_VOTING_USER:
case self::TYPE_ANSWER_HAS_VOTING_USER:
@@ -525,7 +512,6 @@
case self::TYPE_UNSUBSCRIBED_FROM_OBJECT:
case self::TYPE_FILE_HAS_OBJECT:
case self::TYPE_CONTRIBUTED_TO_OBJECT:
- case self::TYPE_PROJECT_HAS_OBJECT:
default:
return '%s updated objects of %s.';

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 17, 11:05 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723863
Default Alt Text
D9849.id23630.diff (18 KB)

Event Timeline