<?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 PageFactoidFootnoteFieldEntity extends GroupFieldEntity
{
  public static string $name = 'aux_page_factoid_footnote';
  protected string $label = 'Factoid Footnote';
  protected RepeaterFieldLayoutEnum $layout = RepeaterFieldLayoutEnum::Block;

  protected array $initFields = [
    PageFactoidFootnoteLinkFieldEntity::class,
    PageFactoidFootnoteYearFieldEntity::class,
  ];

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