<?php
declare(strict_types=1);

namespace AuxCF\Entities\Field\Traits;

use AuxCF\Entities\Settings\Enum\IntSwitchEnum;
use AuxCF\Entities\Settings\Traits\EnumPropertyTraits;

trait UiSwitchTraits
{
  use EnumPropertyTraits;

  protected IntSwitchEnum $ui = IntSwitchEnum::Off;

  public function setUi(int|IntSwitchEnum $ui): self
  {
    $this->setEnumProperty(IntSwitchEnum::class, $ui, 'ui');
    return $this;
  }

  protected function getUiArray(): array
  {
    return [
      'ui' => $this->ui->value
    ];
  }
}
