Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/storage/PhabricatorPaste.php
Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | /* -( PhabricatorConduitResultInterface )---------------------------------- */ | ||||
public function getFieldSpecificationsForConduit() { | public function getFieldSpecificationsForConduit() { | ||||
return array( | return array( | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | id(new PhabricatorConduitSearchFieldSpecification()) | ||||
->setKey('title') | ->setKey('title') | ||||
->setType('string') | ->setType('string') | ||||
->setDescription(pht('The title of the paste.')), | ->setDescription(pht('The title of the paste.')), | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | id(new PhabricatorConduitSearchFieldSpecification()) | ||||
->setKey('uri') | |||||
->setType('uri') | |||||
->setDescription(pht('View URI for the paste.')), | |||||
id(new PhabricatorConduitSearchFieldSpecification()) | |||||
->setKey('authorPHID') | ->setKey('authorPHID') | ||||
->setType('phid') | ->setType('phid') | ||||
->setDescription(pht('User PHID of the author.')), | ->setDescription(pht('User PHID of the author.')), | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | id(new PhabricatorConduitSearchFieldSpecification()) | ||||
->setKey('language') | ->setKey('language') | ||||
->setType('string?') | ->setType('string?') | ||||
->setDescription(pht('Language to use for syntax highlighting.')), | ->setDescription(pht('Language to use for syntax highlighting.')), | ||||
id(new PhabricatorConduitSearchFieldSpecification()) | id(new PhabricatorConduitSearchFieldSpecification()) | ||||
->setKey('status') | ->setKey('status') | ||||
->setType('string') | ->setType('string') | ||||
->setDescription(pht('Active or archived status of the paste.')), | ->setDescription(pht('Active or archived status of the paste.')), | ||||
); | ); | ||||
} | } | ||||
public function getFieldValuesForConduit() { | public function getFieldValuesForConduit() { | ||||
return array( | return array( | ||||
'title' => $this->getTitle(), | 'title' => $this->getTitle(), | ||||
'uri' => PhabricatorEnv::getURI($this->getURI()), | |||||
'authorPHID' => $this->getAuthorPHID(), | 'authorPHID' => $this->getAuthorPHID(), | ||||
'language' => nonempty($this->getLanguage(), null), | 'language' => nonempty($this->getLanguage(), null), | ||||
'status' => $this->getStatus(), | 'status' => $this->getStatus(), | ||||
); | ); | ||||
} | } | ||||
public function getConduitSearchAttachments() { | public function getConduitSearchAttachments() { | ||||
return array( | return array( | ||||
id(new PhabricatorPasteContentSearchEngineAttachment()) | id(new PhabricatorPasteContentSearchEngineAttachment()) | ||||
->setAttachmentKey('content'), | ->setAttachmentKey('content'), | ||||
); | ); | ||||
} | } | ||||
} | } |