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

Make EdgeQuery return array() for empty data instead of null

Summary:
Ref T2852. When we pull edge data and an edge has none, we currently populate `null` in the results. This is inconvenient and makes `idx()`'ing it clumsy. Instead, populate `array()` for empty.

(We've barely used edge data anywhere so far, which is why this hasn't come up before, but I have some use cases for it now.)

Test Plan:
  - Trivial / used in future diff.
  - Verified existing edge data callsites don't care about this API change (there are only 3).

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2852

Differential Revision: https://secure.phabricator.com/D6293
This commit is contained in:
epriestley 2013-06-25 16:30:06 -07:00
parent 42c0f060d5
commit c77bfd6603

View file

@ -189,7 +189,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery {
}
}
foreach ($edges as $key => $edge) {
$edges[$key]['data'] = idx($data_map, $edge['dataID']);
$edges[$key]['data'] = idx($data_map, $edge['dataID'], array());
}
}