getComponentData example

$this->modelManager->flush($preset);

        return $this->preparePresetData($presetData);
    }

    private function refreshElementData(array $elements): array
    {
        $collectedComponents = array_column($elements, 'componentId');
        $collectedComponents = array_keys(array_flip($collectedComponents));

        $components = $this->getComponentData($collectedComponents);

        if ($components) {
            foreach ($elements as &$element) {
                $componentIdentifier = $element['componentId'];
                $element['component'] = $components[$componentIdentifier];
                $element['componentId'] = $element['component']['id'];

                $fieldMapping = [];
                foreach ($element['component']['fields'] as $field) {
                    $fieldMapping[$field['name']] = $field;
                }

                
Home | Imprint | This part of the site doesn't use cookies.