<?php

declare(strict_types=1);

namespace CliqThemes\StoreLocator\Models;

defined('ABSPATH') || exit;

use CliqThemes\ORM\Model;
use CliqThemes\ORM\Relations\BelongsToMany;

final class Category extends Model
{
    protected string $table = 'cliq_sl_categories';

    protected string $primaryKey = 'id';

    protected array $fillable = [
        'id',
        'name',
        'slug',
        'parent_id',
        'icon',
        'color',
        'marker_id',
        'marker_design_id',
        'ordering',
        'is_active',
        'lang',
        'trid',
        'source_id',
        'created_at',
        'updated_at',
    ];

    public function stores(): BelongsToMany
    {
        return $this->belongsToMany(Store::class, 'cliq_sl_store_category', 'category_id', 'store_id');
    }
}
