mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +01:00
32 lines
791 B
PHP
32 lines
791 B
PHP
|
<?php
|
||
|
|
||
|
final class DivinerAtomSearchIndexer extends PhabricatorSearchDocumentIndexer {
|
||
|
|
||
|
public function getIndexableObject() {
|
||
|
return new DivinerLiveSymbol();
|
||
|
}
|
||
|
|
||
|
protected function buildAbstractDocumentByPHID($phid) {
|
||
|
$atom = $this->loadDocumentByPHID($phid);
|
||
|
$book = $atom->getBook();
|
||
|
|
||
|
$doc = $this->newDocument($phid)
|
||
|
->setDocumentTitle($atom->getTitle())
|
||
|
->setDocumentCreated($book->getDateCreated())
|
||
|
->setDocumentModified($book->getDateModified());
|
||
|
|
||
|
$doc->addField(
|
||
|
PhabricatorSearchField::FIELD_BODY,
|
||
|
$atom->getSummary());
|
||
|
|
||
|
$doc->addRelationship(
|
||
|
PhabricatorSearchRelationship::RELATIONSHIP_BOOK,
|
||
|
$atom->getBookPHID(),
|
||
|
DivinerBookPHIDType::TYPECONST,
|
||
|
$book->getDateCreated());
|
||
|
|
||
|
return $doc;
|
||
|
}
|
||
|
|
||
|
}
|