/**
  * Gets an user based on it's user id.
  *
  * - `viewVar` it sets the entity to the view. It's set by default to `user`. To
  *    disable setting the view var just set it to false.
  *
  * @param int|string $userId UUID or integer type user id.
  * @param array $options Configuration options.
  * @return mixed
  */
 public function getUser($userId = null, $options = [])
 {
     $options = Hash::merge($this->_config['getUser'], $options);
     if (is_null($userId)) {
         if (isset($this->request->params['pass'][0])) {
             $userId = $this->request->params['pass'][0];
         }
     }
     $entity = $this->UserTable->getUser($userId);
     if ($options['viewVar'] !== false) {
         $this->_controller->set($options['viewVar'], $entity);
         $this->_controller->set('_serialize', [$options['viewVar']]);
     }
     return $entity;
 }