kernel/private/oauth/classes/restauthorizedclient.php
public static function fetchForClientUser( ezpRestClient $client, eZUser $user )
    {
        $session = ezcPersistentSessionInstance::get();

        $q = $session->createFindQuery( __CLASS__ );

        $q->where( $q->expr->eq( 'rest_client_id', $q->bindValue( $client->id ) ) )
          ->where( $q->expr->eq( 'user_id', $q->bindValue( $user->attribute( 'contentobject_id' ) ) ) );

        $results = $session->find( $q, __CLASS__ );

        if ( count( $results ) != 1 )
            return false;
        else
            return array_shift( $results );
    }
public static function fetchForClientUser( ezpRestClient $client, eZUser $user )
    {
        $session = ezcPersistentSessionInstance::get();

        $q = $session->createFindQuery( __CLASS__ );

        $q->where( $q->expr->eq( 'rest_client_id', $q->bindValue( $client->id ) ) )
          ->where( $q->expr->eq( 'user_id', $q->bindValue( $user->attribute( 'contentobject_id' ) ) ) );

        $results = $session->find( $q, __CLASS__ );

        if ( count( $results ) != 1 )
            return false;
        else
            return array_shift( $results );
    }
public static function fetchForClientUser ( ezpRestClient $ client , eZUser $ user ) { $ session = ezcPersistentSessionInstance :: get ( ) ; $ q = $ session -> createFindQuery ( __CLASS__ ) ; $ q -> where ( $ q -> expr -> eq ( 'rest_client_id' , $ q -> bindValue ( $ client -> id ) ) ) -> where ( $ q -> expr -> eq ( 'user_id' , $ q -> bindValue ( $ user -> attribute ( 'contentobject_id' ) ) ) ) ; $ results = $ session -> find ( $ q , __CLASS__ ) ; if ( count ( $ results ) != 1 ) return false ; else return array_shift ( $ results ) ; }
Returns the authorization object for a user & application
@param ezpRestClient $client
@param eZUser $user
Returns the authorization object for a user & application