1 | <?php |
||
14 | class ArrayToDelimitedStringTransformer implements DataTransformerInterface |
||
15 | { |
||
16 | private $delimiter; |
||
17 | private $paddingLeft; |
||
18 | private $paddingRight; |
||
19 | |||
20 | /** |
||
21 | * Constructor |
||
22 | * |
||
23 | * @param string $delimiter The delimiter to use when transforming from |
||
24 | * a string to an array and vice-versa |
||
25 | * @param integer Number of spaces before each transformed array element |
||
26 | * @param integer Number of spaces after each transformed array element |
||
27 | */ |
||
28 | public function __construct($delimiter = ',', $paddingLeft = 0, $paddingRight = 1) |
||
34 | |||
35 | /** |
||
36 | * Transforms an array into a delimited string |
||
37 | * |
||
38 | * @param array $array Array to transform |
||
39 | * |
||
40 | * @return string |
||
41 | * |
||
42 | * @throws TransformationFailedException If the given value is not an array |
||
43 | */ |
||
44 | public function transform($array) |
||
66 | |||
67 | /** |
||
68 | * Transforms a delimited string into an array |
||
69 | * |
||
70 | * @param string $string String to transform |
||
71 | * |
||
72 | * @return array |
||
73 | * |
||
74 | * @throws TransformationFailedException If the given value is not a string |
||
75 | */ |
||
76 | public function reverseTransform($string) |
||
99 | } |
||
100 |