public function Registration::removeGroup in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 src/Entity/Registration.php \Drupal\rng\Entity\Registration::removeGroup()
- 3.x src/Entity/Registration.php \Drupal\rng\Entity\Registration::removeGroup()
Remove a group from the registration.
Parameters
int $group_id: The ID of a registration_group entity.
Return value
\Drupal\rng\Entity\RegistrationInterface Returns registration for chaining.
Overrides RegistrationInterface::removeGroup
File
- src/
Entity/ Registration.php, line 277
Class
- Registration
- Defines the registration entity class.
Namespace
Drupal\rng\EntityCode
public function removeGroup($group_id) {
foreach ($this->groups
->getValue() as $key => $value) {
if ($value['target_id'] == $group_id) {
$this->groups
->removeItem($key);
}
}
return $this;
}