Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892351
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php b/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php
index f6477836cd..87146d5c62 100644
--- a/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php
+++ b/src/applications/macro/conduit/ConduitAPI_macro_query_Method.php
@@ -1,41 +1,81 @@
<?php
/**
* @group conduit
*/
final class ConduitAPI_macro_query_Method extends ConduitAPI_macro_Method {
public function getMethodDescription() {
return "Retrieve image macro information.";
}
public function defineParamTypes() {
return array(
+ 'authorPHIDs' => 'optional list<phid>',
+ 'phids' => 'optional list<phid>',
+ 'ids' => 'optional list<id>',
+ 'names' => 'optional list<string>',
+ 'nameLike' => 'optional string',
);
}
public function defineReturnType() {
return 'list<dict>';
}
public function defineErrorTypes() {
return array(
);
}
protected function execute(ConduitAPIRequest $request) {
- $macros = id(new PhabricatorMacroQuery())
- ->setViewer($request->getUser())
- ->execute();
+ $query = new PhabricatorMacroQuery();
+ $query->setViewer($request->getUser());
+
+ $author_phids = $request->getValue('authorPHIDs');
+ $phids = $request->getValue('phids');
+ $ids = $request->getValue('ids');
+ $name_like = $request->getValue('nameLike');
+ $names = $request->getValue('names');
+
+ if ($author_phids) {
+ $query->withAuthorPHIDs($author_phids);
+ }
+
+ if ($phids) {
+ $query->withPHIDs($phids);
+ }
+
+ if ($ids) {
+ $query->withIDs($ids);
+ }
+
+ if ($name_like) {
+ $query->withNameLike($name_like);
+ }
+
+ if ($names) {
+ $query->withNames($names);
+ }
+
+ $macros = $query->execute();
+
+ if (!$macros) {
+ return array();
+ }
$results = array();
foreach ($macros as $macro) {
+ $file = $macro->getFile();
$results[$macro->getName()] = array(
- 'uri' => $macro->getFile()->getBestURI(),
+ 'uri' => $file->getBestURI(),
+ 'phid' => $macro->getPHID(),
+ 'authorPHID' => $file->getAuthorPHID(),
+ 'dateCreated' => $file->getDateCreated(),
);
}
return $results;
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 16:40 (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126569
Default Alt Text
(2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment