mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 20:10:55 +01:00
31 lines
651 B
PHP
31 lines
651 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @group search
|
||
|
*/
|
||
|
final class PhabricatorSearchIndexer {
|
||
|
|
||
|
public function indexDocumentByPHID($phid) {
|
||
|
$doc_indexer_symbols = id(new PhutilSymbolLoader())
|
||
|
->setAncestorClass('PhabricatorSearchDocumentIndexer')
|
||
|
->setConcreteOnly(true)
|
||
|
->setType('class')
|
||
|
->selectAndLoadSymbols();
|
||
|
|
||
|
$indexers = array();
|
||
|
foreach ($doc_indexer_symbols as $symbol) {
|
||
|
$indexers[] = newv($symbol['name'], array());
|
||
|
}
|
||
|
|
||
|
foreach ($indexers as $indexer) {
|
||
|
if ($indexer->shouldIndexDocumentByPHID($phid)) {
|
||
|
$indexer->indexDocumentByPHID($phid);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
}
|