public static function getSendTargetUser($activity) {
    // Get target account.
    if (isset($activity->field_activity_recipient_user) && !empty($activity->field_activity_recipient_user->target_id)) {
      $target_id = $activity->field_activity_recipient_user->target_id;
      $target_account = \Drupal::entityTypeManager()
        ->getStorage('user')
        ->load($target_id);
      return $target_account;
    }
  }
public static function getSendTargetUser($activity) {
    // Get target account.
    if (isset($activity->field_activity_recipient_user) && !empty($activity->field_activity_recipient_user->target_id)) {
      $target_id = $activity->field_activity_recipient_user->target_id;
      $target_account = \Drupal::entityTypeManager()
        ->getStorage('user')
        ->load($target_id);
      return $target_account;
    }
  }
public static function getSendTargetUser ( $ activity ) { // Get target account. if ( isset ( $ activity -> field_activity_recipient_user ) && ! empty ( $ activity -> field_activity_recipient_user -> target_id ) ) { $ target_id = $ activity -> field_activity_recipient_user -> target_id ; $ target_account = \ Drupal :: entityTypeManager ( ) -> getStorage ( 'user' ) -> load ( $ target_id ) ; return $ target_account ; } }
Returns target account.
Returns target account .