Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15335987
D14900.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D14900.diff
View Options
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
@@ -3413,6 +3413,7 @@
'PhameBlogProfilePictureController' => 'applications/phame/controller/blog/PhameBlogProfilePictureController.php',
'PhameBlogQuery' => 'applications/phame/query/PhameBlogQuery.php',
'PhameBlogReplyHandler' => 'applications/phame/mail/PhameBlogReplyHandler.php',
+ 'PhameBlogSearchConduitAPIMethod' => 'applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php',
'PhameBlogSearchEngine' => 'applications/phame/query/PhameBlogSearchEngine.php',
'PhameBlogSite' => 'applications/phame/site/PhameBlogSite.php',
'PhameBlogTransaction' => 'applications/phame/storage/PhameBlogTransaction.php',
@@ -7846,6 +7847,7 @@
'PhabricatorProjectInterface',
'PhabricatorDestructibleInterface',
'PhabricatorApplicationTransactionInterface',
+ 'PhabricatorConduitResultInterface',
),
'PhameBlogArchiveController' => 'PhameBlogController',
'PhameBlogController' => 'PhameController',
@@ -7861,6 +7863,7 @@
'PhameBlogProfilePictureController' => 'PhameBlogController',
'PhameBlogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhameBlogReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
+ 'PhameBlogSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
'PhameBlogSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhameBlogSite' => 'PhameSite',
'PhameBlogTransaction' => 'PhabricatorApplicationTransaction',
diff --git a/src/applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php b/src/applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phame/conduit/PhameBlogSearchConduitAPIMethod.php
@@ -0,0 +1,18 @@
+<?php
+
+final class PhameBlogSearchConduitAPIMethod
+ extends PhabricatorSearchEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'phame.blog.search';
+ }
+
+ public function newSearchEngine() {
+ return new PhameBlogSearchEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht('Read information about blogs.');
+ }
+
+}
diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php
--- a/src/applications/phame/storage/PhameBlog.php
+++ b/src/applications/phame/storage/PhameBlog.php
@@ -8,7 +8,8 @@
PhabricatorFlaggableInterface,
PhabricatorProjectInterface,
PhabricatorDestructibleInterface,
- PhabricatorApplicationTransactionInterface {
+ PhabricatorApplicationTransactionInterface,
+ PhabricatorConduitResultInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
@@ -344,4 +345,37 @@
}
+/* -( PhabricatorConduitResultInterface )---------------------------------- */
+
+
+ public function getFieldSpecificationsForConduit() {
+ return array(
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('name')
+ ->setType('string')
+ ->setDescription(pht('The name of the blog.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('description')
+ ->setType('string')
+ ->setDescription(pht('Blog description.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('status')
+ ->setType('string')
+ ->setDescription(pht('Archived or active status.')),
+ );
+ }
+
+ public function getFieldValuesForConduit() {
+ return array(
+ 'name' => $this->getName(),
+ 'description' => $this->getDescription(),
+ 'status' => $this->getStatus(),
+ );
+ }
+
+ public function getConduitSearchAttachments() {
+ return array();
+ }
+
+
}
diff --git a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
--- a/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
+++ b/src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
@@ -15,6 +15,10 @@
}
}
+ if (!$maps) {
+ $maps = (object)$maps;
+ }
+
return $maps;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 9 2025, 5:59 PM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7390328
Default Alt Text
D14900.diff (4 KB)
Attached To
Mode
D14900: Add phame.blog.search Conduit API endpoint
Attached
Detach File
Event Timeline
Log In to Comment