This commit is contained in:
Marcel Pociot
2020-06-04 21:41:31 +02:00
parent df4005482c
commit f3d2b088da
26 changed files with 537 additions and 105 deletions

View File

@@ -0,0 +1,29 @@
---
title: User Repository
order: 2
---
# User Repository
The expose server tries to load users out of the built-in SQLite database by default.
If you want to change the default implementation and load your users from a different storage engine, you can implement the `UserRepository` interface and change it in your expose configuration file.
This is how the interface looks like:
```php
use React\Promise\PromiseInterface;
interface UserRepository
{
public function getUsers(): PromiseInterface;
public function getUserById($id): PromiseInterface;
public function getUserByToken(string $authToken): PromiseInterface;
public function storeUser(array $data): PromiseInterface;
public function deleteUser($id): PromiseInterface;
}
```