public function EventMeta::buildEventRegistrantQuery in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 3.x src/EventMeta.php \Drupal\rng\EventMeta::buildEventRegistrantQuery()
Builds a entity query for registrants with conditions referencing this event via the registration entity.
Return value
\Drupal\Core\Entity\Query\QueryInterface An entity query.
Overrides EventMetaInterface::buildEventRegistrantQuery
File
- src/
EventMeta.php, line 290
Class
- EventMeta
- Meta event wrapper for RNG.
Namespace
Drupal\rngCode
public function buildEventRegistrantQuery() {
// TODO: Rebuild using non-deprecated solution.
$query = db_select('registrant', 'ant');
$query
->join('registration', 'ion', 'ion.id = ant.registration');
$query
->join('registration_field_data', 'rfd', 'ion.id = rfd.id');
$query
->fields('ant', [
'id',
]);
$query
->condition('rfd.event__target_type', $this
->getEvent()
->getEntityTypeId(), '=');
$query
->condition('rfd.event__target_id', $this
->getEvent()
->id(), '=');
return $query;
}