You are here

protected function SimpleSitemapStorage::getIdByDelta in Simple XML sitemap 4.x

3 calls to SimpleSitemapStorage::getIdByDelta()
SimpleSitemapStorage::getChunk in src/Entity/SimpleSitemapStorage.php
@todo Duplicate query.
SimpleSitemapStorage::getIndex in src/Entity/SimpleSitemapStorage.php
@todo Duplicate query.
SimpleSitemapStorage::hasIndex in src/Entity/SimpleSitemapStorage.php

File

src/Entity/SimpleSitemapStorage.php, line 259

Class

SimpleSitemapStorage

Namespace

Drupal\simple_sitemap\Entity

Code

protected function getIdByDelta(SimpleSitemap $entity, int $delta, bool $status) : int {
  foreach ($this
    ->getChunkData($entity) as $chunk) {
    if ($chunk->delta == $delta && $chunk->status == $status) {
      return $chunk->id;
    }
  }
  throw new SitemapNotExistsException();
}