@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3abstract class PhabricatorExportField
4 extends Phobject {
5
6 private $key;
7 private $label;
8
9 public function setKey($key) {
10 $this->key = $key;
11 return $this;
12 }
13
14 public function getKey() {
15 return $this->key;
16 }
17
18 public function setLabel($label) {
19 $this->label = $label;
20 return $this;
21 }
22
23 public function getLabel() {
24 return $this->label;
25 }
26
27 /**
28 * @return string|null
29 */
30 public function getTextValue($value) {
31 $natural_value = $this->getNaturalValue($value);
32
33 if ($natural_value === null) {
34 return null;
35 }
36
37 return (string)$natural_value;
38 }
39
40 public function getNaturalValue($value) {
41 return $value;
42 }
43
44 public function getPHPExcelValue($value) {
45 return $this->getTextValue($value);
46 }
47
48 /**
49 * @phutil-external-symbol class PHPExcel_Cell_DataType
50 */
51 public function formatPHPExcelCell($cell, $style) {
52 $cell->setDataType(PHPExcel_Cell_DataType::TYPE_STRING);
53 }
54
55 public function getCharacterWidth() {
56 return 24;
57 }
58
59}