1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 22:31:03 +01:00

Support search indexing in ApplicationTransaction

Summary: Hook D4261 into ApplicationTransaction

Test Plan: Edited a mock; searched for it.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4262
This commit is contained in:
epriestley 2012-12-21 14:21:50 -08:00
parent f6b1964740
commit 8f0bab73ef
4 changed files with 23 additions and 19 deletions

View file

@ -1265,7 +1265,7 @@ phutil_register_library_map(array(
'PholioMockQuery' => 'applications/pholio/query/PholioMockQuery.php',
'PholioMockViewController' => 'applications/pholio/controller/PholioMockViewController.php',
'PholioReplyHandler' => 'applications/pholio/mail/PholioReplyHandler.php',
'PholioSearchIndexer' => 'applications/pholio/indexer/PholioSearchIndexer.php',
'PholioSearchIndexer' => 'applications/pholio/search/PholioSearchIndexer.php',
'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php',
'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php',
'PholioTransactionQuery' => 'applications/pholio/query/PholioTransactionQuery.php',

View file

@ -16,13 +16,6 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
return $types;
}
protected function didApplyTransactions(
PhabricatorLiskDAO $object,
array $xactions) {
// PholioIndexer::indexMock($mock);
return;
}
protected function getCustomTransactionOldValue(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
@ -129,4 +122,8 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
return true;
}
protected function supportsSearch() {
return true;
}
}

View file

@ -1,8 +1,9 @@
<?php
/**
* @task mail Sending Mail
* @task feed Publishing Feed Stories
* @task mail Sending Mail
* @task feed Publishing Feed Stories
* @task search Search Index
*/
abstract class PhabricatorApplicationTransactionEditor
extends PhabricatorEditor {
@ -193,12 +194,6 @@ abstract class PhabricatorApplicationTransactionEditor
return $this->contentSource;
}
protected function didApplyTransactions(
PhabricatorLiskDAO $object,
array $xactions) {
return;
}
final public function applyTransactions(
PhabricatorLiskDAO $object,
array $xactions) {
@ -278,7 +273,10 @@ abstract class PhabricatorApplicationTransactionEditor
$mail = $this->sendMail($object, $xactions);
}
// TODO: Index object.
if ($this->supportsSearch()) {
id(new PhabricatorSearchIndexer())
->indexDocumentByPHID($object->getPHID());
}
if ($this->supportsFeed()) {
$mailed = array();
@ -291,8 +289,6 @@ abstract class PhabricatorApplicationTransactionEditor
$mailed);
}
$this->didApplyTransactions($object, $xactions);
return $xactions;
}
@ -877,4 +873,15 @@ abstract class PhabricatorApplicationTransactionEditor
->publish();
}
/* -( Search Index )------------------------------------------------------- */
/**
* @task search
*/
protected function supportsSearch() {
return false;
}
}