You are here

public function EventMeta::buildRegistrantQuery in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventMeta.php \Drupal\rng\EventMeta::buildRegistrantQuery()
  2. 8 src/EventMeta.php \Drupal\rng\EventMeta::buildRegistrantQuery()

Builds a entity query for registrants associated to registrations referencing this event.

Parameters

string $entity_type_id: The registrant entity type, or NULL to get all.

Return value

\Drupal\Core\Entity\Query\QueryInterface An entity query.

Overrides EventMetaInterface::buildRegistrantQuery

1 call to EventMeta::buildRegistrantQuery()
EventMeta::getRegistrants in src/EventMeta.php
Get all registrants for this event.

File

src/EventMeta.php, line 461

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function buildRegistrantQuery($entity_type_id = NULL) {
  $query = $this->entityManager
    ->getStorage('registrant')
    ->getQuery('AND')
    ->condition('registration.entity.event__target_type', $this
    ->getEvent()
    ->getEntityTypeId(), '=')
    ->condition('registration.entity.event__target_id', $this
    ->getEvent()
    ->id(), '=');
  if ($entity_type_id) {
    $query
      ->condition('identity__target_type', $entity_type_id, '=');
  }
  return $query;
}