Differential D14842 Diff 35894 src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php
- This file was added.
<?php | |||||
final class PhabricatorCalendarEventFulltextEngine | |||||
extends PhabricatorFulltextEngine { | |||||
protected function buildAbstractDocument( | |||||
PhabricatorSearchAbstractDocument $document, | |||||
$object) { | |||||
$event = $object; | |||||
$document->setDocumentTitle($event->getName()); | |||||
$document->addField( | |||||
PhabricatorSearchDocumentFieldType::FIELD_BODY, | |||||
$event->getDescription()); | |||||
$document->addRelationship( | |||||
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, | |||||
$event->getUserPHID(), | |||||
PhabricatorPeopleUserPHIDType::TYPECONST, | |||||
$event->getDateCreated()); | |||||
$document->addRelationship( | |||||
PhabricatorSearchRelationship::RELATIONSHIP_OWNER, | |||||
$event->getUserPHID(), | |||||
PhabricatorPeopleUserPHIDType::TYPECONST, | |||||
$event->getDateCreated()); | |||||
$document->addRelationship( | |||||
$event->getIsCancelled() | |||||
? PhabricatorSearchRelationship::RELATIONSHIP_CLOSED | |||||
: PhabricatorSearchRelationship::RELATIONSHIP_OPEN, | |||||
$event->getPHID(), | |||||
PhabricatorCalendarEventPHIDType::TYPECONST, | |||||
PhabricatorTime::getNow()); | |||||
} | |||||
} |