1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

Remove ManiphestAuxiliaryFieldSpecification

Summary: Ref T2217. This legacy writer is no longer called.

Test Plan: `grep`

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2217

Differential Revision: https://secure.phabricator.com/D7112
This commit is contained in:
epriestley 2013-09-25 11:16:27 -07:00
parent 487152e67f
commit b16a390509
2 changed files with 0 additions and 57 deletions

View file

@ -690,7 +690,6 @@ phutil_register_library_map(array(
'LiskMigrationIterator' => 'infrastructure/storage/lisk/LiskMigrationIterator.php',
'LiskRawMigrationIterator' => 'infrastructure/storage/lisk/LiskRawMigrationIterator.php',
'ManiphestAction' => 'applications/maniphest/constants/ManiphestAction.php',
'ManiphestAuxiliaryFieldSpecification' => 'applications/maniphest/auxiliaryfield/ManiphestAuxiliaryFieldSpecification.php',
'ManiphestBatchEditController' => 'applications/maniphest/controller/ManiphestBatchEditController.php',
'ManiphestConfiguredCustomField' => 'applications/maniphest/field/ManiphestConfiguredCustomField.php',
'ManiphestConstants' => 'applications/maniphest/constants/ManiphestConstants.php',

View file

@ -1,56 +0,0 @@
<?php
/**
* TODO: Destroy after ApplicationTransactions.
*/
final class ManiphestAuxiliaryFieldSpecification {
public static function writeLegacyAuxiliaryUpdates(
ManiphestTask $task,
array $map) {
$table = new ManiphestCustomFieldStorage();
$conn_w = $table->establishConnection('w');
$update = array();
$remove = array();
foreach ($map as $key => $value) {
$index = PhabricatorHash::digestForIndex($key);
if ($value === null) {
$remove[$index] = true;
} else {
$update[$index] = $value;
}
}
if ($remove) {
queryfx(
$conn_w,
'DELETE FROM %T WHERE objectPHID = %s AND fieldIndex IN (%Ls)',
$table->getTableName(),
$task->getPHID(),
array_keys($remove));
}
if ($update) {
$sql = array();
foreach ($update as $index => $val) {
$sql[] = qsprintf(
$conn_w,
'(%s, %s, %s)',
$task->getPHID(),
$index,
$val);
}
queryfx(
$conn_w,
'INSERT INTO %T (objectPHID, fieldIndex, fieldValue)
VALUES %Q ON DUPLICATE KEY
UPDATE fieldValue = VALUES(fieldValue)',
$table->getTableName(),
implode(', ', $sql));
}
}
}