Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/export/field/PhabricatorExportField.php
12241 views
1
<?php
2
3
abstract 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
public function getTextValue($value) {
28
$natural_value = $this->getNaturalValue($value);
29
30
if ($natural_value === null) {
31
return null;
32
}
33
34
return (string)$natural_value;
35
}
36
37
public function getNaturalValue($value) {
38
return $value;
39
}
40
41
public function getPHPExcelValue($value) {
42
return $this->getTextValue($value);
43
}
44
45
/**
46
* @phutil-external-symbol class PHPExcel_Cell_DataType
47
*/
48
public function formatPHPExcelCell($cell, $style) {
49
$cell->setDataType(PHPExcel_Cell_DataType::TYPE_STRING);
50
}
51
52
public function getCharacterWidth() {
53
return 24;
54
}
55
56
}
57
58