<?php

declare(strict_types=1);

class Usuario extends Model
{
    public function buscarPorEmail(string $email): ?array
    {
        $stmt = $this->db->prepare("SELECT * FROM usuarios WHERE email = :email AND ativo = 1 LIMIT 1");
        $stmt->execute(['email' => $email]);

        $usuario = $stmt->fetch();
        return $usuario ?: null;
    }
}
