You are here

protected function SimplesitemapTest::getOverridesCount in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::getOverridesCount()

Returns the number of entity overrides for the given entity type/ID.

Parameters

string $entity_type_id: The entity type ID.

string $entity_id: The entity ID.

Return value

int The number of overrides for the given entity type ID and entity ID.

1 call to SimplesitemapTest::getOverridesCount()
SimplesitemapTest::testSetEntityInstanceSettings in tests/src/Functional/SimplesitemapTest.php
Test overriding of bundle settings for a single entity.

File

tests/src/Functional/SimplesitemapTest.php, line 452

Class

SimplesitemapTest
Tests Simple XML Sitemap functional integration.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

protected function getOverridesCount($entity_type_id, $entity_id) {
  return $this->database
    ->select('simple_sitemap_entity_overrides', 'o')
    ->fields('o', [
    'inclusion_settings',
  ])
    ->condition('o.entity_type', $entity_type_id)
    ->condition('o.entity_id', $entity_id)
    ->countQuery()
    ->execute()
    ->fetchField();
}