Differential D20641 Diff 49243 src/applications/slowvote/engine/PhabricatorSlowvotePollFulltextEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/slowvote/engine/PhabricatorSlowvotePollFulltextEngine.php
- This file was added.
<?php | |||||
final class PhabricatorSlowvotePollFulltextEngine | |||||
extends PhabricatorFulltextEngine { | |||||
protected function buildAbstractDocument( | |||||
PhabricatorSearchAbstractDocument $document, | |||||
$object) { | |||||
$poll = $object; | |||||
$document->setDocumentTitle($poll->getQuestion()); | |||||
$document->addRelationship( | |||||
$poll->getIsClosed() | |||||
? PhabricatorSearchRelationship::RELATIONSHIP_OPEN | |||||
: PhabricatorSearchRelationship::RELATIONSHIP_CLOSED, | |||||
$poll->getPHID(), | |||||
PhabricatorSlowvotePollPHIDType::TYPECONST, | |||||
PhabricatorTime::getNow()); | |||||
$document->addField( | |||||
PhabricatorSearchDocumentFieldType::FIELD_BODY, | |||||
$poll->getDescription()); | |||||
$document->addRelationship( | |||||
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR, | |||||
$poll->getAuthorPHID(), | |||||
PhabricatorPeopleUserPHIDType::TYPECONST, | |||||
$poll->getDateCreated()); | |||||
} | |||||
} |