<?php

namespace App\Models;

use CodeIgniter\Model;

class PlatformAdminModel extends Model
{
    protected $table            = 'platform_admins';
    protected $primaryKey       = 'id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;
    protected $useTimestamps    = true;
    protected $createdField     = 'created_at';
    protected $updatedField     = 'updated_at';

    protected $allowedFields = ['uuid', 'name', 'email', 'password_hash', 'is_active', 'last_login_at'];

    public function findByEmail(string $email): ?array
    {
        return $this->where('email', $email)->first();
    }
}
