Глава 45: redis

This commit is contained in:
Igor Simdyanov
2022-07-10 16:02:35 +03:00
parent 7c41cafa92
commit c0889e2420
23 changed files with 478 additions and 0 deletions

11
redis/mvc/models/user.php Normal file
View File

@ -0,0 +1,11 @@
<?php
namespace MVC\Models;
class User
{
public function __construct(
public string $email,
private string $password,
public ?string $first_name = null,
public ?string $last_name = null) {}
}

View File

@ -0,0 +1,24 @@
<?php
namespace MVC\Models;
class Users
{
public $collection;
public function __construct(public ?array $users = null)
{
$users ??= [
new User(
'dmitry.koterov@gmail.com',
'password',
'Дмитрий',
'Котеров'),
new User(
'igorsimdyanov@gmail.com',
'password',
'Игорь',
'Симдянов')
];
$this->collection = $users;
}
}