You are here

public function RegistrantsElementUtility::setRegistrants in RNG - Events and Registrations 3.x

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

Sets registrants in form state.

Parameters

\Drupal\rng\Entity\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 127

Class

RegistrantsElementUtility

Namespace

Drupal\rng

Code

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