| @@ 88-98 (lines=11) @@ | ||
| 85 | * @param ContextInterface $context |
|
| 86 | * @return StructureViewInterface[] |
|
| 87 | */ |
|
| 88 | private static function computeStructureViews(StructureMappingInterface $mapping, ContextInterface $context): array |
|
| 89 | { |
|
| 90 | $result = [$mapping->getDefaultView()]; |
|
| 91 | $sources = $mapping->getViews(); |
|
| 92 | foreach ($context->getViews() as $name) { |
|
| 93 | if (isset($sources[$name])) { |
|
| 94 | $result[] = $sources[$name]; |
|
| 95 | } |
|
| 96 | } |
|
| 97 | return $result; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * @param PropertyMappingInterface $mapping |
|
| @@ 105-115 (lines=11) @@ | ||
| 102 | * @param ContextInterface $context |
|
| 103 | * @return PropertyViewInterface[] |
|
| 104 | */ |
|
| 105 | private static function computePropertyViews(PropertyMappingInterface $mapping, ContextInterface $context): array |
|
| 106 | { |
|
| 107 | $result = [$mapping->getDefaultView()]; |
|
| 108 | $sources = $mapping->getViews(); |
|
| 109 | foreach ($context->getViews() as $name) { |
|
| 110 | if (isset($sources[$name])) { |
|
| 111 | $result[] = $sources[$name]; |
|
| 112 | } |
|
| 113 | } |
|
| 114 | return $result; |
|
| 115 | } |
|
| 116 | ||
| 117 | private static function computeChildViews(PropertyViewInterface $view, ContextInterface $context): array |
|
| 118 | { |
|