Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15380631
D20208.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20208.id.diff
View Options
diff --git a/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php b/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
--- a/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
+++ b/src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
@@ -73,24 +73,8 @@
->setViewer($viewer);
$constraints = $request->getValue('constraints', array());
- PhutilTypeSpec::checkMap(
- $constraints,
- array(
- 'phids' => 'optional list<string>',
- ));
- $with_phids = idx($constraints, 'phids');
-
- if ($with_phids === array()) {
- throw new Exception(
- pht(
- 'Constraint "phids" to "transaction.search" requires nonempty list, '.
- 'empty list provided.'));
- }
-
- if ($with_phids) {
- $xaction_query->withPHIDs($with_phids);
- }
+ $xaction_query = $this->applyConstraints($constraints, $xaction_query);
$xactions = $xaction_query->executeWithCursorPager($pager);
@@ -240,4 +224,45 @@
return $this->addPagerResults($results, $pager);
}
+
+ private function applyConstraints(
+ array $constraints,
+ PhabricatorApplicationTransactionQuery $query) {
+
+ PhutilTypeSpec::checkMap(
+ $constraints,
+ array(
+ 'phids' => 'optional list<string>',
+ 'authorPHIDs' => 'optional list<string>',
+ ));
+
+ $with_phids = idx($constraints, 'phids');
+
+ if ($with_phids === array()) {
+ throw new Exception(
+ pht(
+ 'Constraint "phids" to "transaction.search" requires nonempty list, '.
+ 'empty list provided.'));
+ }
+
+ if ($with_phids) {
+ $query->withPHIDs($with_phids);
+ }
+
+ $with_authors = idx($constraints, 'authorPHIDs');
+ if ($with_authors === array()) {
+ throw new Exception(
+ pht(
+ 'Constraint "authorPHIDs" to "transaction.search" requires '.
+ 'nonempty list, empty list provided.'));
+ }
+
+ if ($with_authors) {
+ $query->withAuthorPHIDs($with_authors);
+ }
+
+ return $query;
+ }
+
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 3:55 AM (1 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7682477
Default Alt Text
D20208.id.diff (2 KB)
Attached To
Mode
D20208: Support an "authorPHIDs" constraint for "transaction.search"
Attached
Detach File
Event Timeline
Log In to Comment