<?php
declare(strict_types=1);

namespace WP_AUX\Entities\AuxCF\OptionsFields\PostType;

use AuxCF\Entities\Field\Enum\RelationshipFieldReturnFormatEnum;
use AuxCF\Entities\Field\RelationshipFieldEntity;

class PostTypeOptionsFeaturedPostsFieldEntity extends RelationshipFieldEntity
{
  public static string $namePattern = 'aux_archive_%s_featured_posts';
  public static string $nickname = 'featured_posts';

  protected string $label = 'Featured Post';
  protected string $instructions = '(optional) Highlight a post in the sidebar of the archive for this term.';
  protected ?int $max = 1;
  protected array $postType = [];
  protected RelationshipFieldReturnFormatEnum $returnFormat = RelationshipFieldReturnFormatEnum::Object;

  public function init(): void
  {
    $this->postType = [ $this->getRootWildcard() ];
  }
}
