encodeStruct example


            foreach (\array_keys($struct->getElements()) as $index => $key) {
                if (!isset($data[$index]) || !\is_array($data[$index])) {
                    throw new \RuntimeException(\sprintf('Can not find encoded aggregation %s for data index %d', $key$index));
                }

                $entity = $struct->get($key);
                if (!$entity instanceof Struct) {
                    throw new \RuntimeException(\sprintf('Aggregation %s is not an struct', $key));
                }

                $mapped[$key] = $this->encodeStruct($entity$fields$data[$index]);
            }

            return $mapped;
        }

        if ($struct instanceof EntitySearchResult) {
            $data = $this->encodeStruct($struct$fields$data);

            if (isset($data['elements'])) {
                $entities = [];

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