Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
12253 views
1
<?php
2
3
final class PhabricatorCalendarEventFulltextEngine
4
extends PhabricatorFulltextEngine {
5
6
protected function buildAbstractDocument(
7
PhabricatorSearchAbstractDocument $document,
8
$object) {
9
10
$event = $object;
11
12
$document->setDocumentTitle($event->getName());
13
14
$document->addField(
15
PhabricatorSearchDocumentFieldType::FIELD_BODY,
16
$event->getDescription());
17
18
$document->addRelationship(
19
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
20
$event->getHostPHID(),
21
PhabricatorPeopleUserPHIDType::TYPECONST,
22
$event->getDateCreated());
23
24
$document->addRelationship(
25
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
26
$event->getHostPHID(),
27
PhabricatorPeopleUserPHIDType::TYPECONST,
28
$event->getDateCreated());
29
30
$document->addRelationship(
31
$event->getIsCancelled()
32
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED
33
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
34
$event->getPHID(),
35
PhabricatorCalendarEventPHIDType::TYPECONST,
36
PhabricatorTime::getNow());
37
}
38
39
}
40
41