You are here

protected function DemoUser::fillProfile in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  2. 8 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  3. 8.2 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  4. 8.3 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  5. 8.4 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  6. 8.5 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  7. 8.6 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  8. 8.7 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  9. 8.8 modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  10. 10.3.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  11. 10.0.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()
  12. 10.1.x modules/custom/social_demo/src/DemoUser.php \Drupal\social_demo\DemoUser::fillProfile()

Fills the some fields of a profile.

Parameters

\Drupal\profile\Entity\ProfileInterface $profile: Type of ProfileInterface.

array $item: The profile field item.

1 call to DemoUser::fillProfile()
DemoUser::createContent in modules/custom/social_demo/src/DemoUser.php
Creates content.

File

modules/custom/social_demo/src/DemoUser.php, line 203

Class

DemoUser
Class DemoUser.

Namespace

Drupal\social_demo

Code

protected function fillProfile(ProfileInterface $profile, array $item) {
  $profile->field_profile_image = $item['image'];
  $profile->field_profile_first_name = $item['first_name'];
  $profile->field_profile_last_name = $item['last_name'];
  $profile->field_profile_organization = $item['organization'];
  $profile->field_profile_function = $item['function'];
  $profile->field_profile_phone_number = $item['phone_number'];
  $profile->field_profile_self_introduction = $item['self_introduction'];
  $profile->field_profile_address = $item['address'];
  $profile->field_profile_expertise = $item['expertise'];
  $profile->field_profile_interests = $item['interests'];
}