Takes a user entity and returns the fullname.

@param $user

@return string
328804
private function getUserFullName($user)
    {
        $strReturn = '';
        if ($user && method_exists($user, 'getContact')) {
            $strReturn = $user->getContact()->getFirstName() . ' ' . $user->getContact()->getLastName();
        }

        return $strReturn;
    }
491879
protected function getUser($user)
    {
        $userClass = $this->checkUserClass();
        if (is_numeric($user)) {
            $user = $userClass::find()->id($user)->one();
        } elseif (is_string($user) && strlen($user)) {
            $user = $userClass::find()->guid($user)->one();
        }
        if (!$user || $user->getIsNewRecord()) {
            throw new Exception('User Not Registered.');
        }
        return $user;
    }
1261380
public function user($user = null)
    {
        if ($user !== null) {
            $this->_user = $user;

            return;
        }

        if ($this->_user === false) {
            if (($session = $this->getSession()) && $session->id) {
                $this->_user = auth()->who($session);
            } else {
                $this->_user = null;
            }
        }

        return $this->_user;
    }
1345991
public static String shortName(User user) {
    if (!isEmpty(user.getFirstName()))
      return user.getFirstName();

    if (!isEmpty(user.getLastName()))
      return user.getLastName();

    return user.getUserName();
  }
879088
public function getUserEndorsement($user) {
        return $this->endorsements->filter(function($e) use ($user) {
                    return $e->getUser() == $user;
                })->first();
    }
467342
def full_name(self):
        
        formatted_user = []
        if self.user.first_name is not None:
            formatted_user.append(self.user.first_name)
        if self.user.last_name is not None:
            formatted_user.append(self.user.last_name)
        return " ".join(formatted_user)
657978
public function &user($user = null)
    {
        if($user) {
            $_SESSION[$this->params['session_key']] = $user;
        }
        else {
            if(!$this->check()) {
                throw new UserException('Not logged in', 403);
            }
        }


        return $_SESSION[$this->params['session_key']];
    }
436642
public function getSignature($domain, $user)
    {
        $url = self::BASE_URL . "{$domain}/{$user}/signature";
        $request = new \Google_Http_Request($url, 'GET', null, null);

        $httpRequest = $this->helper->getClient()
           ->getAuth()
           ->authenticatedRequest($request);
        if ($httpRequest->getResponseHttpCode() == 200) {
            $xmlResponse = new \SimpleXMLElement($httpRequest->getResponseBody(), 0, false, 'apps', true);

            return (string)$xmlResponse->children('apps', true)
               ->attributes()->value;
        } else {
            // An error occurred.
            return null;
        }
    }
973605
public function setUserLoggedIn(AdminUser $user): string
    {
        $_SESSION['admin_logged'] = true;
        $_SESSION['admin_id'] = $user->getId();
        $_SESSION['admin_login'] = $user->getLogin();
        $_SESSION['admin_sid'] = Users::getInstance()->startSession($user->getId());

        if (!defined('USER_ID')) {
            define('USER_ID', $user->getId());
        }

        App::add('User "' . $user->getLogin() . '" logged in.');

        return $_SESSION['admin_sid'];
    }
1170107
private function resolveUser($username)
    {
        if (isset($this->knownUsers[strtolower($username)])) {
            return $this->knownUsers[strtolower($username)];
        }

        $repository = $this->entityManager->getRepository(User::class);
        $user = $repository->findOneBy(['uName' => $username]);

        // If we couldn't find the user by username, let's try to get it by email
        if (!$user) {
            $user = $repository->findOneBy(['uEmail' => $username]);
        }

        // No user to actually track against.
        if (!$user) {
            return null;
        }

        /**
         * I don't know what detach is doing or why it's here, but it's causing an exception on UserSignup
         * not being a known entity. Much like drugs, `detach` is not the answer
         */
        //$this->entityManager->detach($user);
        $this->knownUsers[strtolower($username)] = $user;
        return $user;
    }
1254476
private function getFullCustomerObject($customer)
    {
        // No need to flatten the custom attributes or nested objects since the only usage is for email templates and
        // object passed for events
        $mergedCustomerData = $this->customerRegistry->retrieveSecureData($customer->getId());
        $customerData = $this->dataProcessor
            ->buildOutputDataArray($customer, \Magento\Customer\Api\Data\CustomerInterface::class);
        $mergedCustomerData->addData($customerData);

        return $mergedCustomerData;
    }
644680
function getAbsDir($user)
    {
        if (!$this->users[$user]['chroot'])
        {
            $rdir = $this->users[$user]['pwd'];
        }
        else
        {
            $rdir = $this->users[$user]['home'].$this->users[$user]['pwd'];
        }
        return $rdir;
    }
758455
public function getUserForUsername($username)
    {
        if (!$this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username)) {
            return false;
        }
        
        // Get the access entity
        $accessEntity = $this->accessControlManager->getAccessEntityForName(self::ACCESS_ENTITY_TYPE, $username);

        if ($accessEntity === false) {
            return false;
        }
        
        return $accessEntity;
    }
314362
public static String fullName(User user) {
    StringJoiner name = new StringJoiner(" ");

    if (!isEmpty(user.getFirstName()))
      name.add(user.getFirstName());
    if (!isEmpty(user.getLastName()))
      name.add(user.getLastName());

    return name.toString();
  }
965086
public function deserializeFromString($user)
    {
        $base64EncodedUserValues = json_decode(base64_decode($user), true);
        if (!is_array($base64EncodedUserValues)) {
            return null;
        }

        if (empty($base64EncodedUserValues)) {
            return null;
        }

        $expectedKeys = [
            self::SERIALIZED_USER_USERNAME_KEY,
            self::SERIALIZED_USER_PASSWORD_KEY,
            self::SERIALIZED_USER_KEY_KEY,
        ];

        foreach ($expectedKeys as $expectedKey) {
            if (!isset($base64EncodedUserValues[$expectedKey])) {
                return null;
            }
        }

        $userValues = [];

        foreach ($base64EncodedUserValues as $key => $value) {
            $base64DecodedValue = base64_decode($value);
            if ($base64DecodedValue == '') {
                return null;
            }

            $userValues[$key] = $base64DecodedValue;
        }

        return $this->deserialize($userValues);
    }
311268
private function getUserInputEntity($entity)
    {
        // Get rid of any special chars introduced.
        $entity = $this->makeSQLUnsafe($entity);

        // Only replace first occurrence.
        return preg_replace('/' . $this->getParams()['DBPREFIX'] . '/', '', $entity, 1);
    }
1267750
protected function getUserSessionId($user)
    {
        $model = $this->getUserModel();
        
        if ($user instanceof $model) {
            return array_get($this->users, $user->getKey(), false);
        } elseif ($model::find($user) !== null) {
            return array_get($this->users, $user, false);
        }
        
        return false;
    }