public function EventMeta::buildRegistrantQuery in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/EventMeta.php \Drupal\rng\EventMeta::buildRegistrantQuery()
- 3.x 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 452
Class
- EventMeta
- Meta event wrapper for RNG.
Namespace
Drupal\rngCode
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;
}