Generate image line of sitemap.

@param array $data List of parameters
499533
private function generateImageLine(array $data): string
    {
        $images = '';

        if (\count($data['images']) > 1000) {
            $data['images'] = array_splice($data['images'], 1000);
        }

        $builder = [
            'url' => 'loc',
            'location' => 'geo_location',
        ];

        foreach ($data['images'] as $image) {
            $images .= '<image:image>';

            foreach ($image as $key => $element) {
                $images .= sprintf('<image:%1$s>%2$s</image:%1$s>', ($builder[$key] ?? $key), $element);
            }

            $images .= '</image:image>';
        }

        return sprintf('    '.'<url><loc>%s</loc>%s</url>'."\n", $data['url'], $images);
    }
1343623
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $beGroupUids = $recordFinder->findUidsOfDemoBeGroups();
        $beUserUids = $recordFinder->findUidsOfDemoBeUsers();
        $result = [];
        foreach ($beGroupUids as $uid) {
            $result[] = 'be_groups_' . $uid;
        }
        foreach ($beUserUids as $uid) {
            $result[] = 'be_users_' . $uid;
        }
        return implode(',', $result);
    }
1108121
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $staticDataRecords = $recordFinder->findUidsOfStaticdata();
        // Select first two
        return implode(',', array_slice($staticDataRecords, 0, 2));
    }
1154254
protected function make_row($data)
    {
        $line = [];
        foreach ($this->cols as $i => $key) {
            $value = (array_key_exists($i, $data) ? $data[$i] : '');
            $value = ($this->utf8 ? utf8_decode($value) : $value);
            $line[$key] = $value;
        }

        return $line;
    }
80609
private function httpBuildQuery(array $data): string
    {
        $queryString = http_build_query($data, '', '&');

        return $this->postProcessHttpQueryString($queryString, $data);
    }
785847
public static function makeFromApi(array $data)
    {
        if (isset($data['type'])) {
            switch ($data['type']) {
                case Type::TEXT:
                    return new Text($data);
                case Type::URL:
                    return new Url($data);
                case Type::PICTURE:
                    return new Picture($data);
                case Type::CONTACT:
                    return new Contact($data);
                case Type::VIDEO:
                    return new Video($data);
                case Type::FILE:
                    return new File($data);
                case Type::STICKER:
                    return new Sticker($data);
                case Type::LOCATION:
                    return new Location($data);
            }
        }
        throw new ApiException('Unknow message data');
    }
1110472
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $staticdataUids = $recordFinder->findUidsOfStaticdata();
        // Return only one element
        return (string)current($staticdataUids);
    }
584820
public function setData(array $data = [])
    {
        $this->default = empty($data);

        $this->data = array_replace([
            static::VISIBLE_COLUMNS => [],
            static::MAX_PER_PAGE    => null,
            static::CONFIG          => null,
            static::PAGE_NUM        => null,
            static::SORT            => null,
            static::ADD_FILTER      => null,
            static::REMOVE_FILTER   => null,
            static::IDENTIFIERS     => [],
            static::ALL             => null,
            static::BATCH           => null,
            static::ACTION          => null,
            static::EXPORT          => null,
            static::FORMAT          => null,
            static::PROFILE         => [],
        ], $data);
    }
932134
public function format(array $data)
    {
        $value = parent::format($data);
        foreach ($this->list as $uri => $values) {
            if (in_array($value, $values)) {
                return $uri;
            }
        }
        return '';
    }
1367623
private function createArrayLines(array $data, $prefix = '')
    {
        $content = '';

        foreach ($data as $key => $value) {
            $newKey = "{$prefix}[$key]";

            if (is_array($value)) {
                $content .= $this->createArrayLines($value, $newKey);
                continue;
            }

            $content .= $this->createPropertyLine($newKey, $value);
        }

        return $content;
    }
610657
private function add(array $data)
    {
        foreach ($this->sanitize($data) as $row) {
            if (!is_array($row) || (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT])) {
                $this->addFlatFromArray($row);
            } else {
                if (!isset($this->_options['objectType'])) {
                    $this->addDocumentsFromArray($row);
                } else {
                    switch ($this->_options['objectType']) {
                        case 'edge' :
                            $this->addEdgesFromArray($row);
                            break;
                        case 'vertex' :
                            $this->addVerticesFromArray($row);
                            break;
                        case 'path' :
                            $this->addPathsFromArray($row);
                            break;
                        case 'shortestPath' :
                            $this->addShortestPathFromArray($row);
                            break;
                        case 'distanceTo' :
                            $this->addDistanceToFromArray($row);
                            break;
                        case 'commonNeighbors' :
                            $this->addCommonNeighborsFromArray($row);
                            break;
                        case 'commonProperties' :
                            $this->addCommonPropertiesFromArray($row);
                            break;
                        case 'figure' :
                            $this->addFigureFromArray($row);
                            break;
                        default :
                            $this->addDocumentsFromArray($row);
                            break;
                    }
                }
            }
        }
    }
1195514
public static function getGeneratorFromParametersData(array $data): string
    {
        assert(array_key_exists(self::KEY_ROUTER_PARAMS__GENERATOR, $data));
        $result = $data[self::KEY_ROUTER_PARAMS__GENERATOR];
        assert(empty($result) === false);
        assert(static::classImplements($result, DataGenerator::class));

        return $result;
    }
367799
public function populate($data = array())
    {
        if (isset($data['title']) && $data['title'] != null) {
            $this->title = $data['title'];
        }

        if (isset($data['image']) && $data['image'] != null) {
            $this->image = $data['image'];
        }

        if (isset($data['area']) && $data['area'] != null) {
            $this->area = $data['area'];
        }

        if (isset($data['package']) && $data['package'] != null) {
            $this->package = $data['package'];
        }

        if (isset($data['theme']) && $data['theme'] != null) {
            $this->theme = $data['theme'];
        }

        if (isset($data['author']) && $data['author'] != null) {
            $this->author = $data['author'];
        }

        if (isset($data['is_active']) && $data['is_active'] != null) {
            $this->is_active = $data['is_active'];
        }
    }
540089
protected function createLegacyXml(array $data)
    {
        $data['uri'] = $this->urlRedecorator->redecorateFromSource($data['uri']);
        $pathInfo = pathinfo($data['uri']);

        return $this->fillXml($data, $pathInfo, time());
    }
1202670
public function addImageMetadata(array $data, array $metadata)
    {
        $data['metadata'] = [];

        foreach ($metadata as $meta_name => $meta_value) {
            $data['metadata'][$meta_name] = $meta_value;
        }

        return $data;
    }
72837
public function createListItem(array $data = [])
    {
        $listItem = new Account\ListItem();

        if (array_key_exists('poster_path', $data)) {
            $listItem->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
        }

        return $this->hydrate($listItem, $data);
    }
12819
public function maybeCropImage($data)
    {
        if (!$data['mod_image_crop']) {
            return $data['mod_image_image']['sizes'][$data['mod_image_size']];
        }

        $imageSrc = wp_get_attachment_image_src(
            $data['mod_image_image']['ID'],
            apply_filters('Modularity/image/image',
                municipio_to_aspect_ratio('16:9', array($data['mod_image_crop_width'], $data['mod_image_crop_height']))
            )
        );

        return $imageSrc[0];
    }