You are here

public function RngRegistrationTypeTest::countEventRegistrationTypeReferences in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 src/Tests/RngRegistrationTypeTest.php \Drupal\rng\Tests\RngRegistrationTypeTest::countEventRegistrationTypeReferences()
  2. 3.x src/Tests/RngRegistrationTypeTest.php \Drupal\rng\Tests\RngRegistrationTypeTest::countEventRegistrationTypeReferences()

Count references from event entities to registration types.

Parameters

string $entity_type: An entity type ID.

string $registration_type: A registration type ID.

Return value

int Number of references.

1 call to RngRegistrationTypeTest::countEventRegistrationTypeReferences()
RngRegistrationTypeTest::testRegistrationTypeAPIDelete in src/Tests/RngRegistrationTypeTest.php
Test registration type deletion.

File

src/Tests/RngRegistrationTypeTest.php, line 135

Class

RngRegistrationTypeTest
Tests registration types.

Namespace

Drupal\rng\Tests

Code

public function countEventRegistrationTypeReferences($entity_type, $registration_type) {
  return \Drupal::entityTypeManager()
    ->getStorage($entity_type)
    ->getQuery()
    ->condition(EventManagerInterface::FIELD_REGISTRATION_TYPE, $registration_type)
    ->count()
    ->execute();
}