You are here

public function Utility::faqAskReassign in FAQ_Ask 8

Reassign the node to the current user and display a message.

1 call to Utility::faqAskReassign()
FaqAskController::askAnswerViewSettings in src/Controller/FaqAskController.php
This function is called when an expert selects a question to answer.

File

src/Utility.php, line 47
Contains \Drupal\faq_ask\Utility.

Class

Utility
Contains static helper functions for FAQ module.

Namespace

Drupal\faq_ask

Code

public function faqAskReassign(&$node) {
  $user = \Drupal::currentUser();
  $node_uid = $node
    ->get('uid')
    ->getValue();
  $node_uid[0]['target_id'] = $user
    ->id();
  $usetrObj = user_load($user
    ->id());
  drupal_set_message(t('This question is being assigned to !user.', array(
    '!user' => $usetrObj
      ->get('name')->value,
  )));
}