<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\PageFields\Page;

use AuxCF\Entities\Field\Enum\RepeaterFieldLayoutEnum;
use AuxCF\Entities\Field\GroupFieldEntity;
use AuxCF\Entities\Settings\Enum\OperatorEnum;
use WP_AUX\Enum\PageHeaderTypeEnum;
use WP_AUX\Enum\PageMediaEnum;

class PageFactoidFieldEntity extends GroupFieldEntity
{
  public static string $name = 'aux_page_factoid';
	public static string $nickname = 'factoid';

  protected string $label = 'Page Factoid';
  protected RepeaterFieldLayoutEnum $layout = RepeaterFieldLayoutEnum::Block;

  protected array $initFields = [
    PageFactoidHeadingFieldEntity::class,
    PageFactoidTextFieldEntity::class,
    PageFactoidSuperheaderFieldEntity::class,
    PageFactoidSubheaderFieldEntity::class,
    PageFactoidFootnoteFieldEntity::class,
    PageFactoidQuickFactSwitchFieldEntity::class,
  ];

  protected array $initConditionalLogic = [
    [
      [ PageMediaTypeFieldEntity::class, OperatorEnum::EQUALS, PageMediaEnum::Factoid ],
      [ PageHeaderTypeFieldEntity::class, OperatorEnum::EQUALS, PageHeaderTypeEnum::Standard ],
    ],
  ];
}
