newQuery(); if ($map['documentPHIDs']) { $query->withDocumentPHIDs($map['documentPHIDs']); } if ($map['versions']) { $query->withVersions($map['versions']); } return $query; } protected function buildCustomSearchFields() { return array( id(new PhabricatorPHIDsSearchField()) ->setKey('documentPHIDs') ->setAliases(array('document', 'documents', 'documentPHID')) ->setLabel(pht('Documents')) ->setDescription( pht( 'Search for documents with specific PHIDs.')), id(new PhabricatorIDsSearchField()) ->setKey('versions') ->setAliases(array('version')) ->setLabel(pht('Versions')) ->setDescription( pht( 'Search for documents with specific versions.')), ); } protected function getURI($path) { // There's currently no web UI for this search interface, it exists purely // to power the Conduit API. throw new PhutilMethodNotImplementedException(); } protected function getBuiltinQueryNames() { return array( 'all' => pht('All Content'), ); } public function buildSavedQueryFromBuiltin($query_key) { $query = $this->newSavedQuery(); $query->setQueryKey($query_key); switch ($query_key) { case 'all': return $query; } return parent::buildSavedQueryFromBuiltin($query_key); } /** * @param array $contents * @param PhabricatorSavedQuery $query * @param array $handles */ protected function renderResultList( array $contents, PhabricatorSavedQuery $query, array $handles) { assert_instances_of($contents, PhrictionContent::class); throw new PhutilMethodNotImplementedException(); } }