You are here

public function MultiStepStorage::setValues in User Merge 2.x

Save form values in store.

Parameters

string $property: Id of property plugin.

array $values: An associative array of values submitted to the form.

Throws

\Drupal\Core\TempStore\TempStoreException

Overrides MultiStepStorageInterface::setValues

File

src/MultiStepStorage.php, line 49

Class

MultiStepStorage
Class MultiStepStorage.

Namespace

Drupal\usermerge

Code

public function setValues($property, array $values) : void {

  // Remove not needed values.
  $skip_values = [
    'form_build_id',
    'form_token',
    'form_id',
  ];
  foreach ($skip_values as $skip_value) {
    if (isset($values[$skip_value])) {
      unset($values[$skip_value]);
    }
  }

  // Skip values which are not a string.
  foreach ($values as $key => $value) {
    if (is_object($value)) {
      unset($values[$key]);
    }
  }
  $this->store
    ->set($property, $values);
}