Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / search / PhabricatorCalendarEventFulltextEngine.php
blobd50a86915e053706a7c06f0d571023a128f07626
1 <?php
3 final class PhabricatorCalendarEventFulltextEngine
4 extends PhabricatorFulltextEngine {
6 protected function buildAbstractDocument(
7 PhabricatorSearchAbstractDocument $document,
8 $object) {
10 $event = $object;
12 $document->setDocumentTitle($event->getName());
14 $document->addField(
15 PhabricatorSearchDocumentFieldType::FIELD_BODY,
16 $event->getDescription());
18 $document->addRelationship(
19 PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
20 $event->getHostPHID(),
21 PhabricatorPeopleUserPHIDType::TYPECONST,
22 $event->getDateCreated());
24 $document->addRelationship(
25 PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
26 $event->getHostPHID(),
27 PhabricatorPeopleUserPHIDType::TYPECONST,
28 $event->getDateCreated());
30 $document->addRelationship(
31 $event->getIsCancelled()
32 ? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
33 : PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
34 $event->getPHID(),
35 PhabricatorCalendarEventPHIDType::TYPECONST,
36 PhabricatorTime::getNow());