How to alter the owner/authored by field to the current user when using quick_node_clone Using Drupal 8 with quick_node_clone module. 

When a node is cloned I need to change the 'owner' or 'authored by' value to the person who is cloning the node. 

There is an opportunity of manually changing this but I need to automate this. 
I am have been trying the hook_form_alter with some alternatives, see the commented out section, without success. 

function quick_node_clone_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

 print_r($form_id);  

 if ($form_id == 'quick_node_clone') {
  // change author
  //$form['author']['name']['#value'] = $user-&gt;uid;
  //$form-&gt;setOwnerId($current_user);
  //$form-&gt;uid = $user-&gt;uid;

  print_r($form['field_author']['nid']['nid']['#value']);  
  global $user;    
  $form['field_author']['nid']['nid']['#value'] == $user-&gt;uid;
 }
}


Any direction would be appreciated.
Try this out:

use Drupal\Core\Entity\EntityInterface;
/**
 * Implements hook_entity_presave().
 */
function customModule_entity_presave(EntityInterface $entity) {
  $current_user_id = \Drupal::currentUser()-&gt;id();
  $entity-&gt;setOwnerId($current_user_id);
}


Edit
You would be better to check on your content type:

use Drupal\Core\Entity\EntityInterface;

/**
 * Implements hook_entity_presave().
 */
function customModule_entity_presave(EntityInterface $entity) {
  $current_user_id = \Drupal::currentUser()-&gt;id();
  if ($entity-&gt;bundle() == 'your_content_type_name'){
    $entity-&gt;setOwnerId($current_user_id);
  }
}