<?php
declare(strict_types=1);

namespace AuxCF\Entities\Field;

use AuxCF\Entities\Field\Enum\FieldTypeEnum;
use AuxCF\Entities\Field\Enum\WysiwygFieldTabsEnum;
use AuxCF\Entities\Field\Enum\WysiwygFieldToolbarEnum;
use AuxCF\Entities\FieldEntity;
use AuxCF\Entities\Settings\Enum\IntSwitchEnum;

class WysiwygFieldEntity extends FieldEntity
{
  protected FieldTypeEnum $type = FieldTypeEnum::WYSIWYG;

  protected IntSwitchEnum $mediaUpload = IntSwitchEnum::Off;
  protected IntSwitchEnum $delay = IntSwitchEnum::Off;
  protected WysiwygFieldToolbarEnum $toolbar = WysiwygFieldToolbarEnum::DEFAULT;
  protected WysiwygFieldTabsEnum $tabs = WysiwygFieldTabsEnum::DEFAULT;

  public function getFieldArray(): array
  {
    $array = [
      'tabs' => $this->tabs->value,
      'toolbar' => $this->toolbar->value,
      'media_upload' => $this->mediaUpload->value,
      'delay' => $this->delay->value,
    ];

    return $array;
  }
}
