mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement separated models
This commit is contained in:
parent
47b7344e2e
commit
10534df069
17 changed files with 662 additions and 520 deletions
31
src/Model/Database/Auth.php
Normal file
31
src/Model/Database/Auth.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Model\Database;
|
||||
|
||||
use \Pdo;
|
||||
|
||||
class Auth
|
||||
{
|
||||
public Pdo $connection;
|
||||
|
||||
public function __construct(
|
||||
Pdo $connection
|
||||
) {
|
||||
// Init parent connection
|
||||
$this->connection = $connection;
|
||||
|
||||
// Init database structure
|
||||
$this->connection->query('
|
||||
CREATE TABLE IF NOT EXISTS `auth`
|
||||
(
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`time` INTEGER NOT NULL,
|
||||
`active` INTEGER NOT NULL,
|
||||
`identity` INTEGER NOT NULL,
|
||||
`request` VARCHAR(1024) NOT NULL
|
||||
)
|
||||
');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue