Differential D14675 Diff 35496 src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/typeahead/datasource/PhabricatorTypeaheadDatasource.php
| Show First 20 Lines • Show All 463 Lines • ▼ Show 20 Lines | public function getWireTokens(array $values) { | ||||
| // is pretty silly. It would probably be much cleaner to make | // is pretty silly. It would probably be much cleaner to make | ||||
| // renderTokens() call this method instead, then render from the result | // renderTokens() call this method instead, then render from the result | ||||
| // structure. | // structure. | ||||
| $rendered = $this->renderTokens($values); | $rendered = $this->renderTokens($values); | ||||
| $tokens = array(); | $tokens = array(); | ||||
| foreach ($rendered as $key => $render) { | foreach ($rendered as $key => $render) { | ||||
| $tokens[$key] = id(new PhabricatorTypeaheadResult()) | $tokens[$key] = id(new PhabricatorTypeaheadResult()) | ||||
| ->setPHID($key) | ->setPHID($render->getKey()) | ||||
| ->setIcon($render->getIcon()) | ->setIcon($render->getIcon()) | ||||
| ->setColor($render->getColor()) | ->setColor($render->getColor()) | ||||
| ->setDisplayName($render->getValue()) | ->setDisplayName($render->getValue()) | ||||
| ->setTokenType($render->getTokenType()); | ->setTokenType($render->getTokenType()); | ||||
| } | } | ||||
| return mpull($tokens, 'getWireFormat'); | return mpull($tokens, 'getWireFormat', 'getPHID'); | ||||
| } | } | ||||
| } | } | ||||