Remove product literal strings in "pht()", part 18
[phabricator.git] / src / infrastructure / export / field / PhabricatorOptionExportField.php
blobe6d3e9b45bfd19ca297e7b24252a2174555ba8d2
1 <?php
3 final class PhabricatorOptionExportField
4 extends PhabricatorExportField {
6 private $options;
8 public function setOptions(array $options) {
9 $this->options = $options;
10 return $this;
13 public function getOptions() {
14 return $this->options;
17 public function getNaturalValue($value) {
18 if ($value === null) {
19 return $value;
22 if (!strlen($value)) {
23 return null;
26 $options = $this->getOptions();
28 return array(
29 'value' => (string)$value,
30 'name' => (string)idx($options, $value, $value),
34 public function getTextValue($value) {
35 $natural_value = $this->getNaturalValue($value);
36 if ($natural_value === null) {
37 return null;
40 return $natural_value['name'];
43 public function getPHPExcelValue($value) {
44 return $this->getTextValue($value);