Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / paste / engine / PhabricatorPasteFulltextEngine.php
blob22005a8ca7050c3fe7c92a2b38445ce4b960af60
1 <?php
3 final class PhabricatorPasteFulltextEngine
4 extends PhabricatorFulltextEngine {
6 protected function buildAbstractDocument(
7 PhabricatorSearchAbstractDocument $document,
8 $object) {
10 $paste = id(new PhabricatorPasteQuery())
11 ->setViewer($this->getViewer())
12 ->withPHIDs(array($object->getPHID()))
13 ->needContent(true)
14 ->executeOne();
16 $document->setDocumentTitle($paste->getTitle());
18 $document->addRelationship(
19 $paste->isArchived()
20 ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
21 : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
22 $paste->getPHID(),
23 PhabricatorPastePastePHIDType::TYPECONST,
24 PhabricatorTime::getNow());
26 $document->addField(
27 PhabricatorSearchDocumentFieldType::FIELD_BODY,
28 $paste->getContent());
30 $document->addRelationship(
31 PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
32 $paste->getAuthorPHID(),
33 PhabricatorPeopleUserPHIDType::TYPECONST,
34 $paste->getDateCreated());