@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement countdown.search and countdown.edit

Summary: adds new conduit methods for countdown.edit and countdown.search

Test Plan:
Search: {P2037}
Edit: {P2038}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12524

Differential Revision: https://secure.phabricator.com/D17679

+79 -2
+5
src/__phutil_library_map__.php
··· 338 338 'ConpherenceUpdateController' => 'applications/conpherence/controller/ConpherenceUpdateController.php', 339 339 'ConpherenceUpdateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceUpdateThreadConduitAPIMethod.php', 340 340 'ConpherenceViewController' => 'applications/conpherence/controller/ConpherenceViewController.php', 341 + 'CountdownEditConduitAPIMethod' => 'applications/countdown/conduit/CountdownEditConduitAPIMethod.php', 342 + 'CountdownSearchConduitAPIMethod' => 'applications/countdown/conduit/CountdownSearchConduitAPIMethod.php', 341 343 'DarkConsoleController' => 'applications/console/controller/DarkConsoleController.php', 342 344 'DarkConsoleCore' => 'applications/console/core/DarkConsoleCore.php', 343 345 'DarkConsoleDataController' => 'applications/console/controller/DarkConsoleDataController.php', ··· 5127 5129 'ConpherenceUpdateController' => 'ConpherenceController', 5128 5130 'ConpherenceUpdateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 5129 5131 'ConpherenceViewController' => 'ConpherenceController', 5132 + 'CountdownEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 5133 + 'CountdownSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 5130 5134 'DarkConsoleController' => 'PhabricatorController', 5131 5135 'DarkConsoleCore' => 'Phobject', 5132 5136 'DarkConsoleDataController' => 'PhabricatorController', ··· 7513 7517 'PhabricatorSpacesInterface', 7514 7518 'PhabricatorProjectInterface', 7515 7519 'PhabricatorDestructibleInterface', 7520 + 'PhabricatorConduitResultInterface', 7516 7521 ), 7517 7522 'PhabricatorCountdownApplication' => 'PhabricatorApplication', 7518 7523 'PhabricatorCountdownController' => 'PhabricatorController',
+18
src/applications/countdown/conduit/CountdownEditConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class CountdownEditConduitAPIMethod 4 + extends PhabricatorEditEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'countdown.edit'; 8 + } 9 + 10 + public function newEditEngine() { 11 + return new PhabricatorCountdownEditEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht( 16 + 'Apply transactions to create a new countdown or edit an existing one.'); 17 + } 18 + }
+18
src/applications/countdown/conduit/CountdownSearchConduitAPIMethod.php
··· 1 + <?php 2 + 3 + final class CountdownSearchConduitAPIMethod 4 + extends PhabricatorSearchEngineAPIMethod { 5 + 6 + public function getAPIMethodName() { 7 + return 'countdown.search'; 8 + } 9 + 10 + public function newSearchEngine() { 11 + return new PhabricatorCountdownSearchEngine(); 12 + } 13 + 14 + public function getMethodSummary() { 15 + return pht('Read information about countdowns.'); 16 + } 17 + 18 + }
+38 -2
src/applications/countdown/storage/PhabricatorCountdown.php
··· 9 9 PhabricatorTokenReceiverInterface, 10 10 PhabricatorSpacesInterface, 11 11 PhabricatorProjectInterface, 12 - PhabricatorDestructibleInterface { 12 + PhabricatorDestructibleInterface, 13 + PhabricatorConduitResultInterface { 13 14 14 15 protected $title; 15 16 protected $authorPHID; ··· 151 152 152 153 153 154 public function destroyObjectPermanently( 154 - PhabricatorDestructionEngine $engine) { 155 + PhabricatorDestructionEngine $engine) { 155 156 156 157 $this->openTransaction(); 157 158 $this->delete(); 158 159 $this->saveTransaction(); 159 160 } 161 + 162 + /* -( PhabricatorConduitResultInterface )---------------------------------- */ 163 + 164 + 165 + public function getFieldSpecificationsForConduit() { 166 + return array( 167 + id(new PhabricatorConduitSearchFieldSpecification()) 168 + ->setKey('title') 169 + ->setType('string') 170 + ->setDescription(pht('The title of the countdown.')), 171 + id(new PhabricatorConduitSearchFieldSpecification()) 172 + ->setKey('description') 173 + ->setType('remarkup') 174 + ->setDescription(pht('The description of the countdown.')), 175 + id(new PhabricatorConduitSearchFieldSpecification()) 176 + ->setKey('epoch') 177 + ->setType('epoch') 178 + ->setDescription(pht('The end date of the countdown.')), 179 + ); 180 + } 181 + 182 + public function getFieldValuesForConduit() { 183 + return array( 184 + 'title' => $this->getTitle(), 185 + 'description' => array( 186 + 'raw' => $this->getDescription(), 187 + ), 188 + 'epoch' => (int)$this->getEpoch(), 189 + ); 190 + } 191 + 192 + public function getConduitSearchAttachments() { 193 + return array(); 194 + } 195 + 160 196 }