id:1, name:'BBL'
Код: Выделить всё
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
return [
'id'=>$user->get('field_org')->value,
'name' => ...
]
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-of-field
Код: Выделить всё
$user = \Drupal\user\Entity\User::load(\Drupal::currentUser()->id());
return [
'id'=>$user->get('field_org')->value,
'name' => ...
]