<?php

namespace App\Models;

use App\Core\Model;

class WidgetModel extends Model
{
    protected string $table = 'widgets';

    public function getByPosisi(string $posisi): array
    {
        $stmt = $this->db->prepare(
            "SELECT * FROM {$this->table} WHERE posisi = :posisi AND is_active = 1 ORDER BY urutan ASC"
        );
        $stmt->execute(['posisi' => $posisi]);

        return $stmt->fetchAll();
    }
}
