1 | <?php |
||
15 | class CellHelper |
||
16 | { |
||
17 | /** |
||
18 | * Fixed character array to build cell ids, because chr(65+n) |
||
19 | * eats to much performance. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private static $chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); |
||
24 | |||
25 | /** |
||
26 | * Control character map for escaping. |
||
27 | * |
||
28 | * @var array(array()) |
||
29 | */ |
||
30 | private static $ctrls = array(); |
||
31 | |||
32 | /** |
||
33 | * Build and return the string for a single cell. |
||
34 | * Wheter a numeric value is written as a number |
||
35 | * or string type cell is determined by type, |
||
36 | * which allows for some control by typecasting. |
||
37 | * |
||
38 | * @param int $rowId |
||
39 | * @param int $cellNo |
||
40 | * @param string $value |
||
41 | * @param int|null $styleId |
||
42 | * @return string |
||
43 | * @throws \InvalidArgumentException |
||
44 | */ |
||
45 | 3 | public static function buildCell($rowId, $cellNo, $value, $styleId = 0) |
|
60 | |||
61 | /** |
||
62 | * Turn a integer cell number + row number into a valid cell identifier |
||
63 | * like e.g. A1, Z1, AA1 etc and return it. |
||
64 | * |
||
65 | * @param int $cellNo |
||
66 | * @param int|null $rowIndex |
||
67 | * @return string |
||
68 | */ |
||
69 | 3 | private static function buildId($cellNo, $rowIndex = null) |
|
77 | |||
78 | /** |
||
79 | * Set mapping for control character escaping. |
||
80 | * |
||
81 | * @param array $map |
||
82 | */ |
||
83 | 4 | public static function setCtrlCharacterMap(array $map) |
|
87 | } |
||
88 |