1 | <?php |
||
32 | class ValueCsvSerializer extends AbstractCsvSerializer |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * The delimiter to override the one from the configuration with. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | private $delimiter; |
||
41 | |||
42 | /** |
||
43 | * The delimiter to use instead the one from the configuration. |
||
44 | * |
||
45 | * @param string $delimiter The delimiter |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 5 | protected function setDelimiter($delimiter) |
|
53 | |||
54 | /** |
||
55 | * Returns the delimiter to use instead the one from the configuration. |
||
56 | * |
||
57 | * @return string The delimiter |
||
58 | */ |
||
59 | 6 | protected function getDelimiter() |
|
63 | |||
64 | /** |
||
65 | * Serializes the elements of the passed array by using the |
||
66 | * instances CSV configuration options. |
||
67 | * |
||
68 | * @param array|null $unserialized The serialized data |
||
69 | * |
||
70 | * @return string|null The serialized array |
||
71 | */ |
||
72 | 3 | public function serialize(array $unserialized = null) |
|
96 | |||
97 | /** |
||
98 | * Unserializes the elements of the passed value by using the |
||
99 | * instances CSV configuration options. |
||
100 | * |
||
101 | * @param string|null $serialized The value to unserialize |
||
102 | * |
||
103 | * @return array|null The exploded values |
||
104 | */ |
||
105 | 4 | public function unserialize($serialized = null) |
|
124 | |||
125 | /** |
||
126 | * Extracts the elements of the passed value by exploding them |
||
127 | * with the also passed delimiter. |
||
128 | * |
||
129 | * @param string|null $value The value to extract |
||
130 | * @param string|null $delimiter The delimiter used to extrace the elements |
||
131 | * |
||
132 | * @return array|null The exploded values |
||
133 | * @see \TechDivision\Import\Serializers\ValueCsvSerializer::unserialize() |
||
134 | */ |
||
135 | 3 | public function explode($value = null, $delimiter = null) |
|
144 | |||
145 | /** |
||
146 | * Compacts the elements of the passed value by imploding them |
||
147 | * with the also passed delimiter. |
||
148 | * |
||
149 | * @param array|null $value The values to compact |
||
150 | * @param string|null $delimiter The delimiter use to implode the values |
||
151 | * |
||
152 | * @return string|null The compatected value |
||
153 | * @see \TechDivision\Import\Serializers\ValueCsvSerializer::serialize() |
||
154 | */ |
||
155 | 2 | public function implode(array $value = null, $delimiter = null) |
|
164 | } |
||
165 |