20250808-1
This commit is contained in:
@@ -30,9 +30,11 @@ namespace App\Models;
|
||||
|
||||
use goodboyalex\php_db_components_pack\attributes\AutoIncrement;
|
||||
use goodboyalex\php_db_components_pack\attributes\FieldName;
|
||||
use goodboyalex\php_db_components_pack\attributes\IgnoredInDB;
|
||||
use goodboyalex\php_db_components_pack\attributes\NotNull;
|
||||
use goodboyalex\php_db_components_pack\attributes\PrimaryKey;
|
||||
use goodboyalex\php_db_components_pack\attributes\Unique;
|
||||
use goodboyalex\php_db_components_pack\enums\DBOperation;
|
||||
use goodboyalex\php_db_components_pack\interfaces\IDBItem;
|
||||
|
||||
class User implements IDBItem
|
||||
@@ -40,7 +42,7 @@ class User implements IDBItem
|
||||
/**
|
||||
* @var int $Id Идентификатор пользователя.
|
||||
*/
|
||||
#[PrimaryKey, NotNull, AutoIncrement, FieldName('id'), Unique]
|
||||
#[PrimaryKey, NotNull, AutoIncrement, FieldName('id'), Unique, IgnoredInDB(DBOperation::Insert)]
|
||||
public int $Id = 0;
|
||||
|
||||
/**
|
||||
@@ -54,6 +56,19 @@ class User implements IDBItem
|
||||
*/
|
||||
#[NotNull, FieldName('user_mail'), Unique]
|
||||
public string $Email = '';
|
||||
|
||||
/**
|
||||
* Конструктор.
|
||||
*
|
||||
* @param int $id Идентификатор пользователя
|
||||
* @param string $name Имя пользователя
|
||||
* @param string $email Адрес EMAIL
|
||||
*/
|
||||
public function __construct(int $id = 0, string $name = "", string $email = "") {
|
||||
$this->Id = $id;
|
||||
$this->Name = $name;
|
||||
$this->Email = $email;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user