Get the binding associated to a specific user.

@param \Concrete\Core\User\User|\Concrete\Core\User\UserInfo|\Concrete\Core\Entity\User\User|int $user

@return string|null
498770
public function getBindingForUser($user)
    {
        $result = null;
        if (is_object($user)) {
            $userID = $user->getUserID();
        } else {
            $userID = (int) $user;
        }
        if ($userID) {
            $db = $this->app->make(Connection::class);
            $qb = $db->createQueryBuilder();
            $qb->select('oum.binding')
                ->from('OauthUserMap', 'oum')
                ->where($qb->expr()->eq('oum.user_id', ':user_id'))->setParameter('user_id', $userID)
                ->andWhere($qb->expr()->eq('oum.namespace', ':namespace'))->setParameter('namespace', $this->getHandle())
                ->setMaxResults(1);
            $rs = $qb->execute();
            /* @var \Concrete\Core\Database\Driver\PDOStatement $rs */
            $row = $rs->fetch();
            $rs->closeCursor();
            if ($row !== false) {
                $result = array_pop($row);
            }
        }

        return $result;
    }
287174
public function getPropertyValue($user, $property = self::LOGIN_PROPERTY, $strict = false)
    {
        if ($this->checkProperty($property, $strict)) {
            $oid = spl_object_hash($user);
            if (null !== $cacheHit = $this->resolveCache($oid, $property)) {
                return $cacheHit;
            }

            if (is_string($this->properties[$property])) {
                $this->properties[$property] = new ReflectionProperty($user, $this->properties[$property]);
            }
            $this->properties[$property]->setAccessible(true);

            return $this->lazyValueCache[$oid][$property] = $this->properties[$property]->getValue($user);
        }
    }
1229089
public function getUserOptions(User $user)
    {
        $options = $this->optionsRepo->findOneBy(['user' => $user]);

        if (is_null($options)) {
            $options = new Options();
            $options->setUser($user);
            $defaultValues = [
                'show_all_my_contacts' => true,
                'show_all_visible_users' => true,
                'show_username' => true,
                'show_mail' => false,
                'show_phone' => false,
                'show_picture' => true,
            ];
            $options->setOptions($defaultValues);
            $this->om->persist($options);
            $this->om->flush();
        }

        return $options;
    }
755429
public function setUser(\Core\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }
291344
protected function getUserEntity() : ?User
    {
        if (!$this->userEntity && $this->userId)
        {
            $this->userEntity = $this->userRepository->findOneById($this->userId);
        }

        return $this->userEntity;
    }
202372
protected function _getCurrentUser($user = null)
    {
        $this->_setCurrentUser($user);

        if (!$this->_currentUserInstance &&
            isset($this->_currentUserViewVar) &&
            !empty($this->viewVars[$this->_currentUserViewVar])
        ) {
            $this->_currentUserInstance = $this->viewVars[$this->_currentUserViewVar];
        }

        return $this->_currentUserInstance;
    }
193132
public function getUserMainDomain(User $user) {
    if($this->domainEnabled) {
      $groups = Group::getUserGroup($user);
      if (is_array($groups)) {
        foreach ($groups as $group) {
          if ($domaine = $group->getDomain()) {
            if ($domaine->status()) {
              return $domaine;
            }
          }
        }
      }
    }
    return NULL;
  }
393550
protected function setAuthorizer($user)
	{
		if($user !== false && $this->authorizer !== null && $user instanceof AuthorizableInterface)
		{
			$user->setAuthorizer($this->authorizer);
		}

		return $user;
	}
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;
    }
153360
private function getCommand($user = null)
    {
        $command = $this->executable;

        if ($user) {
            $command .= ' -u' . $user;
        }

        return $command;
    }
522222
public function findPlatformRoles(User $user)
    {
        $dql = "
            SELECT r FROM Claroline\CoreBundle\Entity\Role r
            JOIN r.users u
            WHERE u.id = {$user->getId()} AND r.type = ".Role::PLATFORM_ROLE;
        $query = $this->_em->createQuery($dql);

        return $query->getResult();
    }
400873
public function getUserSetting(User $user, $name, $default = null)
    {
        if (false === $user->getSettings()->containsKey($name)) {
            $this->loadusersSettings();

            return array_key_exists($name, $this->usersSettings) ? $this->usersSettings[$name] : $default;
        }

        return $user->getSettings()->get($name)->getValue();
    }
816924
public function getNotification($user)
    {
        return MessageNotification::where('user_id', $user->getKey())
            ->where('message_id', $this->id)
            ->select(['mc_message_notification.*', 'mc_message_notification.updated_at as read_at'])
            ->first();
    }
233355
public function getUserEntity($user)
    {
        if (is_numeric($user)) {
            $userEntity = $this->entityTypeManager
                ->getStorage('user')
                ->load($user);
        } else {
            $userEntities = $this->entityTypeManager
                ->getStorage('user')
                ->loadByProperties(['name' => $user]);
            $userEntity = reset($userEntities);
        }

        return $userEntity;
    }
914801
public function user($user = null)
    {
        if ($user !== null) {
            $this->user = $user;
        }

        return $this->user;
    }
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;
    }
1101158
public function deleteUser(User $user)
    {
        $returnValue = $this->service->deleteUser($user);
        $this->signalDispatcher->emit(
            new DeleteUserSignal(
                array(
                    'userId' => $user->id,
                    'affectedLocationIds' => $returnValue,
                )
            )
        );

        return $returnValue;
    }