@@ 27-39 (lines=13) @@ | ||
24 | * @param array $array |
|
25 | * @param string $typeKey |
|
26 | */ |
|
27 | public static function deletePropertiesNotInFilter(array &$mappings, array &$array, $typeKey) |
|
28 | { |
|
29 | if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) { |
|
30 | $newArray = []; |
|
31 | $type = $array[Serializer::CLASS_IDENTIFIER_KEY]; |
|
32 | ||
33 | self::deleteMatchedClassNotInFilterProperties($mappings, $array, $typeKey, $type, $newArray); |
|
34 | ||
35 | if (!empty($newArray)) { |
|
36 | $array = $newArray; |
|
37 | } |
|
38 | } |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @param \NilPortugues\Api\Mapping\Mapping[] $mappings |
@@ 49-61 (lines=13) @@ | ||
46 | * @param array $array |
|
47 | * @param string $typeKey |
|
48 | */ |
|
49 | public static function renameKeyValue(array &$mappings, array &$array, $typeKey) |
|
50 | { |
|
51 | if (\array_key_exists(Serializer::CLASS_IDENTIFIER_KEY, $array)) { |
|
52 | $newArray = []; |
|
53 | $type = $array[Serializer::CLASS_IDENTIFIER_KEY]; |
|
54 | ||
55 | self::renameMatchedClassKeys($mappings, $array, $typeKey, $type, $newArray); |
|
56 | ||
57 | if (!empty($newArray)) { |
|
58 | $array = $newArray; |
|
59 | } |
|
60 | } |
|
61 | } |
|
62 | ||
63 | /** |
|
64 | * @param \NilPortugues\Api\Mapping\Mapping[] $mappings |