concrete/src/Authentication/Type/OAuth/GenericOauthTypeController.php
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;
    }
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;
    }
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 ; }
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
Get the binding associated to a specific user .