You are here

public function RegistrantsElementUtility::setRegistrants in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::setRegistrants()
  2. 3.x src/RegistrantsElementUtility.php \Drupal\rng\RegistrantsElementUtility::setRegistrants()

Sets registrants in form state.

Parameters

\Drupal\rng\RegistrantInterface[] $registrants: An array of registrants.

2 calls to RegistrantsElementUtility::setRegistrants()
RegistrantsElementUtility::addRegistrant in src/RegistrantsElementUtility.php
RegistrantsElementUtility::replaceFirstRegistrant in src/RegistrantsElementUtility.php

File

src/RegistrantsElementUtility.php, line 116

Class

RegistrantsElementUtility

Namespace

Drupal\rng

Code

public function setRegistrants(array $registrants) {
  $this->formState
    ->set(array_merge($this->element['#parents'], [
    'registrants',
  ]), $registrants);
}