mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 11:22:40 +01:00
aab1574e33
Summary: Ref T9979. This event had one weird callsite and no known third-party callers. It can be done more cleanly as an extension, now. This index is used to allow us to "Group By: Project" in Maniphest without joining into the Projects database. Test Plan: - Ran a query with "Group By: Project" in Maniphest. - Renamed project "Apples" to "Zebras". - Reloaded page. - UI properly moved "Zebras" tasks to the bottom of the list. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9979 Differential Revision: https://secure.phabricator.com/D14836
25 lines
566 B
PHP
25 lines
566 B
PHP
<?php
|
|
|
|
final class ManiphestProjectNameFulltextEngineExtension
|
|
extends PhabricatorFulltextEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'maniphest.project.name';
|
|
|
|
public function getExtensionName() {
|
|
return pht('Maniphest Project Name Cache');
|
|
}
|
|
|
|
public function shouldIndexFulltextObject($object) {
|
|
return ($object instanceof PhabricatorProject);
|
|
}
|
|
|
|
public function indexFulltextObject(
|
|
$object,
|
|
PhabricatorSearchAbstractDocument $document) {
|
|
|
|
ManiphestNameIndex::updateIndex(
|
|
$object->getPHID(),
|
|
$object->getName());
|
|
}
|
|
|
|
}
|