<?php
/// file: app/Models/Admin.php

declare(strict_types=1);

namespace App\Models;

use App\Core\Model;
use PDO;

final class Admin extends Model
{
    protected static function table(): string
    {
        return 'admins';
    }

    /** @return array<string, mixed>|null */
    public static function findByEmail(string $email): ?array
    {
        $st = self::pdo()->prepare('SELECT * FROM admins WHERE email = ? LIMIT 1');
        $st->execute([$email]);
        $row = $st->fetch(PDO::FETCH_ASSOC);
        return $row ?: null;
    }
}
