# yatra/3.0.14.2/app/Sitemap/Integrations/AbstractIndexIntegration.php

Yatra – Travel Booking &amp; Tour Operator Software, version 3.0.14.2. 44 lines.

- Page: https://pluginprobe.com/plugins/yatra/3.0.14.2/code/app/Sitemap/Integrations/AbstractIndexIntegration.php
- Raw: https://pluginprobe.com/plugins/yatra/3.0.14.2/raw/app/Sitemap/Integrations/AbstractIndexIntegration.php
- Modified: 2026-06-26T07:21:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/3.0.14.2/code/app/Sitemap/Integrations/AbstractIndexIntegration.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Yatra\Sitemap\Integrations;

use Yatra\Sitemap\SitemapRenderer;
use Yatra\Sitemap\SitemapRouter;
use Yatra\Sitemap\SitemapService;

/**
 * Shared base for SEO plugins whose sitemap index is a filterable XML string
 * (Yoast, Rank Math). We append a single <sitemap> node pointing at Yatra's
 * own consolidated /yatra-sitemap.xml, so the plugin's index links to our one
 * file without us re-implementing its rendering.
 */
abstract class AbstractIndexIntegration
{
    protected SitemapService $service;
    protected SitemapRouter $router;
    protected SitemapRenderer $renderer;

    public function __construct(SitemapService $service, SitemapRouter $router, SitemapRenderer $renderer)
    {
        $this->service = $service;
        $this->router = $router;
        $this->renderer = $renderer;
    }

    abstract public function register(): void;

    /**
     * @param mixed $output Existing index XML (string).
     */
    public function append($output): string
    {
        $pointer = $this->renderer->indexEntries([
            ['loc' => $this->router->sitemapUrl(), 'lastmod' => $this->service->getLatestLastmod()],
        ]);

        return (string) $output . $pointer;
    }
}

```
