src/Model/Table/UsersTable.php
public function findToken($query, $options)
    {
        return $this->find()->matching('Tokens', function ($q) use ($options) {
            return $q->where(['Tokens.token' => $options['token']]);
        });
    }
public function findToken($query, $options)
    {
        return $this->find()->matching('Tokens', function ($q) use ($options) {
            return $q->where(['Tokens.token' => $options['token']]);
        });
    }
public function findToken ( $ query , $ options ) { return $ this -> find ( ) -> matching ( 'Tokens' , function ( $ q ) use ( $ options ) { return $ q -> where ( [ 'Tokens.token' => $ options [ 'token' ] ] ) ; } ) ; }
Find user based on token

@param \Cake\ORM\Query $query The query to find with
@param array $options The options to find with
@return \Cake\ORM\Query The query builder
Find user based on token