1 | <?php |
||
6 | class UnknownPropertiesItemConverter implements ItemConverterInterface |
||
7 | { |
||
8 | |||
9 | private $knownProperties; |
||
10 | |||
11 | private $targetProperty; |
||
12 | |||
13 | private $skipEmptyKey; |
||
14 | |||
15 | 3 | public function __construct(array $knownProperties, $targetProperty = 'ATTRIBUTES', $skipEmptyKey = true) |
|
16 | { |
||
17 | 3 | $this->knownProperties = array_map("strtoupper", $knownProperties); |
|
18 | 3 | $this->targetProperty = $targetProperty; |
|
19 | 3 | $this->skipEmptyKey = $skipEmptyKey; |
|
20 | |||
21 | 3 | if (!in_array(strtoupper($this->targetProperty), $this->knownProperties)) { |
|
22 | 3 | $this->knownProperties[] = strtoupper($this->targetProperty); |
|
23 | } |
||
24 | 3 | } |
|
25 | |||
26 | 1 | public static function fromClass($cls, $targetProperty = 'ATTRIBUTES', $skipEmptyKey = true) |
|
36 | |||
37 | 3 | public function convert($input) |
|
63 | |||
64 | } |
||
65 |