getEntityManager()->getRepository('User')->findOne([ 'whereClause' => [ 'type' => 'api', 'apiKey' => $apiKey, 'authMethod' => 'ApiKey', ] ]); return $user; } }