Page MenuHomePhabricator

D14900.diff
No OneTemporary

D14900.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
@@ -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

Mime Type
text/plain
Expires
Thu, May 9, 6:59 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6275473
Default Alt Text
D14900.diff (4 KB)

Event Timeline