Define common ID and PHID export fields in SearchEngine

Summary:
Ref T13049. All exportable objects should always have these fields, so make them builtins.

This also sets things up for extensions (like custom fields).

Test Plan: Exported user data, got the same export as before.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13049

Differential Revision: https://secure.phabricator.com/D18951
This commit is contained in:
epriestley
2018-01-28 18:24:42 -08:00
parent 1db281bcd1
commit 213eb8e93d
4 changed files with 66 additions and 30 deletions

View File

@@ -449,18 +449,7 @@ final class PhabricatorApplicationSearchController
$format->setViewer($viewer);
$export_data = $engine->newExport($objects);
if (count($export_data) !== count($objects)) {
throw new Exception(
pht(
'Search engine exported the wrong number of objects, expected '.
'%s but got %s.',
phutil_count($objects),
phutil_count($export_data)));
}
$objects = array_values($objects);
$export_data = array_values($export_data);
$field_list = $engine->newExportFieldList();
$field_list = mpull($field_list, null, 'getKey');