27 lines
665 B
PHP
27 lines
665 B
PHP
<?php
|
|
|
|
namespace Tests\Models;
|
|
|
|
use DateTime;
|
|
use Libs\Model;
|
|
|
|
/**
|
|
* User - DuckBrain test fixture
|
|
*
|
|
* Public model used by the integration matrix. $id is declared WITHOUT a
|
|
* default so it stays uninitialized until the database assigns it:
|
|
* Model::getVars() skips uninitialized typed properties, which lets
|
|
* AUTOINCREMENT / AUTO_INCREMENT / SERIAL generate the primary key and
|
|
* Model::add() assign it back to the instance.
|
|
*/
|
|
final class User extends Model
|
|
{
|
|
public ?int $id;
|
|
public string $username;
|
|
public ?string $email;
|
|
public ?string $bio;
|
|
public ?int $age;
|
|
public bool $isActive = false;
|
|
public ?DateTime $lastLogin;
|
|
}
|