You are here

function registration_property_user_set in Entity Registration 8

Same name and namespace in other branches
  1. 7 registration.module \registration_property_user_set()

Callback to set $registration->user that supports null value.

1 string reference to 'registration_property_user_set'
RegistrationMetadataController::entityPropertyInfo in src/RegistrationMetadataController.php

File

./registration.module, line 1707

Code

function registration_property_user_set(Registration $registration, $name, $value, $lang, $type, $info) {
  if (is_object($value) && ($account = $value
    ->value())) {
    $registration->{$info['schema field']} = $account->uid;
  }
  else {
    $registration->{$info['schema field']} = NULL;
  }
}