<?php

namespace Apexl\Io\Menu\Entities;

use Apexl\Io\Entity;
use Apexl\Io\Enums\Casts;
use Apexl\Io\Menu\Entities\Operators\MenuLinksOperator;
use Apexl\Io\Traits\HasCasts;
use DateTimeImmutable;

/**
 * @property int $id
 * @property int $mid
 * @property string $routeName
 * @property string $href
 * @property string $permission
 * @property int $parentId
 * @property string $title
 * @property string $icon
 * @property bool $active
 * @property int $weight
 * @property DateTimeImmutable $created
 * @property DateTimeImmutable $modified
 */
class MenuLinkEntity extends Entity
{
    public const string TABLE = 'menu_links';

    protected const string OPERATOR = MenuLinksOperator::class;

    use HasCasts;

    public function casts(): array
    {
        return [
            'id' => Casts::INT,
            'mid' => Casts::INT,
            'parentId' => Casts::INT,
            'active' => Casts::BOOL,
            'weight' => Casts::INT,
            'created' => Casts::DATETIME_STAMP,
            'modified' => Casts::DATETIME_STAMP,
        ];
    }
}
