You are here

public function SimpleSitemapStorage::getCreated in Simple XML sitemap 4.x

File

src/Entity/SimpleSitemapStorage.php, line 305

Class

SimpleSitemapStorage

Namespace

Drupal\simple_sitemap\Entity

Code

public function getCreated(SimpleSitemap $entity, ?bool $status = SimpleSitemap::FETCH_BY_STATUS_ALL) : ?string {
  foreach ($this
    ->getChunkData($entity) as $chunk) {
    if ($status === SimpleSitemap::FETCH_BY_STATUS_ALL || $chunk->status == $status) {
      return $chunk->sitemap_created;
    }
  }
  return NULL;
}