Differential D9859 Diff 23678 src/applications/conpherence/conduit/ConduitAPI_conpherence_createthread_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/conduit/ConduitAPI_conpherence_createthread_Method.php
| <?php | <?php | ||||
| /** | |||||
| * @group conduit | |||||
| */ | |||||
| final class ConduitAPI_conpherence_createthread_Method | final class ConduitAPI_conpherence_createthread_Method | ||||
| extends ConduitAPI_conpherence_Method { | extends ConduitAPI_conpherence_Method { | ||||
| public function getMethodDescription() { | public function getMethodDescription() { | ||||
| return pht('Create a new conpherence thread.'); | return pht('Create a new conpherence thread.'); | ||||
| } | } | ||||
| public function defineParamTypes() { | public function defineParamTypes() { | ||||
| Show All 13 Lines | return array( | ||||
| 'ERR_EMPTY_PARTICIPANT_PHIDS' => pht( | 'ERR_EMPTY_PARTICIPANT_PHIDS' => pht( | ||||
| 'You must specify participant phids.'), | 'You must specify participant phids.'), | ||||
| 'ERR_EMPTY_MESSAGE' => pht( | 'ERR_EMPTY_MESSAGE' => pht( | ||||
| 'You must specify a message.') | 'You must specify a message.') | ||||
| ); | ); | ||||
| } | } | ||||
| protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
| $participant_phids = $request->getValue('participantPHIDs', array()); | $participant_phids = $request->getValue('participantPHIDs', array()); | ||||
| $message = $request->getValue('message'); | $message = $request->getValue('message'); | ||||
| $title = $request->getValue('title'); | $title = $request->getValue('title'); | ||||
| list($errors, $conpherence) = ConpherenceEditor::createConpherence( | list($errors, $conpherence) = ConpherenceEditor::createConpherence( | ||||
| $request->getUser(), | $request->getUser(), | ||||
| $participant_phids, | $participant_phids, | ||||
| $title, | $title, | ||||
| Show All 11 Lines | if ($errors) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return array( | return array( | ||||
| 'conpherenceID' => $conpherence->getID(), | 'conpherenceID' => $conpherence->getID(), | ||||
| 'conpherencePHID' => $conpherence->getPHID(), | 'conpherencePHID' => $conpherence->getPHID(), | ||||
| 'conpherenceURI' => $this->getConpherenceURI($conpherence)); | 'conpherenceURI' => $this->getConpherenceURI($conpherence), | ||||
| ); | |||||
| } | } | ||||
| } | } | ||||