<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\Fields\Card;

use AuxCF\Entities\Field\Enum\LinkFieldReturnFormatEnum;
use AuxCF\Entities\Field\LinkFieldEntity;
use AuxCF\Entities\Settings\Enum\OperatorEnum;
use WP_AUX\Entities\AuxCF\Fields\Section\SectionCardsCtaTypeFieldEntity;
use WP_AUX\Entities\AuxCF\Fields\FeaturedCard\CardsCtaTypeFieldEntity;
use WP_AUX\Entities\AuxCF\Fields\Section\SectionCardsLayoutSwitchFieldEntity;
use WP_AUX\Enum\CtaTypes\AllCtaNoButtonsTypesEnum;

class CardCtaFieldEntity extends LinkFieldEntity
{
  public static string $name = 'card_cta';
  protected string $label = 'Card CTA';
  protected string $instructions = 'Select link destination and link text for the CTA.';
  protected LinkFieldReturnFormatEnum $returnFormat = LinkFieldReturnFormatEnum::Array;

  protected array $initConditionalLogic = [
    [
      [ SectionCardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::LinkedHeading ],
      [ CardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::LinkedHeading ],
    ],
    [
      [ SectionCardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::Link ],
      [ CardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::Link ],
    ],
    [
      [ SectionCardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::Button ],
      [ CardsCtaTypeFieldEntity::class, OperatorEnum::EQUALS, AllCtaNoButtonsTypesEnum::Button ],
    ],
  ];

}
