You are here

public function Simplesitemap::removeEntityInstanceSettings in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/Simplesitemap.php \Drupal\simple_sitemap\Simplesitemap::removeEntityInstanceSettings()

Removes sitemap settings for an entity that overrides the sitemap settings of its bundle.

Parameters

string $entity_type_id:

string|null $entity_ids:

Return value

$this

2 calls to Simplesitemap::removeEntityInstanceSettings()
Simplesitemap::disableEntityType in src/Simplesitemap.php
Disables sitemap support for an entity type. Disabling support for an entity type deletes its sitemap settings permanently and removes sitemap settings from entity forms.
Simplesitemap::setEntityInstanceSettings in src/Simplesitemap.php
Overrides entity bundle/entity type sitemap settings for a single entity.

File

src/Simplesitemap.php, line 576

Class

Simplesitemap
Class Simplesitemap @package Drupal\simple_sitemap

Namespace

Drupal\simple_sitemap

Code

public function removeEntityInstanceSettings($entity_type_id, $entity_ids = NULL) {
  $query = $this->db
    ->delete('simple_sitemap_entity_overrides')
    ->condition('entity_type', $entity_type_id);
  if (NULL !== $entity_ids) {
    $entity_ids = !is_array($entity_ids) ? [
      $entity_ids,
    ] : $entity_ids;
    $query
      ->condition('entity_id', $entity_ids, 'IN');
  }
  $query
    ->execute();
  return $this;
}