Page MenuHomePhorge

PhrictionDocumentFulltextEngine.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PhrictionDocumentFulltextEngine.php

<?php
final class PhrictionDocumentFulltextEngine
extends PhabricatorFulltextEngine {
protected function buildAbstractDocument(
PhabricatorSearchAbstractDocument $document,
$object) {
$wiki = id(new PhrictionDocumentQuery())
->setViewer($this->getViewer())
->withPHIDs(array($document->getPHID()))
->needContent(true)
->executeOne();
$content = $wiki->getContent();
$document->setDocumentTitle($content->getTitle());
// TODO: These are not quite correct, but we don't currently store the
// proper dates in a way that's easy to get to.
$document
->setDocumentCreated($content->getDateCreated())
->setDocumentModified($content->getDateModified());
$document->addField(
PhabricatorSearchDocumentFieldType::FIELD_BODY,
$content->getContent());
$document->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
$content->getAuthorPHID(),
PhabricatorPeopleUserPHIDType::TYPECONST,
$content->getDateCreated());
$document->addRelationship(
($wiki->getStatus() == PhrictionDocumentStatus::STATUS_EXISTS)
? PhabricatorSearchRelationship::RELATIONSHIP_OPEN
: PhabricatorSearchRelationship::RELATIONSHIP_CLOSED,
$wiki->getPHID(),
PhrictionDocumentPHIDType::TYPECONST,
PhabricatorTime::getNow());
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Jun 17, 11:44 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
219782
Default Alt Text
PhrictionDocumentFulltextEngine.php (1 KB)

Event Timeline