<?php

namespace App\Models;

use App\Core\Model;

class HomepageSection extends Model
{
    protected static string $table = 'iw_homepage_sections';

    public static function active(): array
    {
        return static::where(['is_active' => 1], 'sort_order', 'ASC');
    }

    public static function getByKey(string $key): ?array
    {
        return static::findWhere(['section_key' => $key]);
    }
}
