public function EventMeta::removeRegistrationType in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/EventMeta.php \Drupal\rng\EventMeta::removeRegistrationType()
- 3.x src/EventMeta.php \Drupal\rng\EventMeta::removeRegistrationType()
Removes references to an allowed registration type from the event.
Parameters
string $registration_type_id: The ID of a registration_type entity.
Return value
\Drupal\Core\Entity\EntityInterface The modified event.
Overrides EventMetaInterface::removeRegistrationType
File
- src/
EventMeta.php, line 198
Class
- EventMeta
- Meta event wrapper for RNG.
Namespace
Drupal\rngCode
public function removeRegistrationType($registration_type_id) {
/** @var \Drupal\Core\Field\FieldItemListInterface $registration_types */
$registration_types =& $this->entity->{EventManagerInterface::FIELD_REGISTRATION_TYPE};
foreach ($registration_types
->getValue() as $key => $value) {
if ($value['target_id'] == $registration_type_id) {
$registration_types
->removeItem($key);
}
}
return $this->entity;
}