<?php

namespace ProudNerds\Helpers;

class FieldsBuilder
{
    public const THEME_OPTIONS = 'theme-options';

    private static array $instances = [];

    /**
     * Get an instance of the FieldsBuilder
     * @param string $key
     * @return \StoutLogic\AcfBuilder\FieldsBuilder
     */
    public static function getInstance(string $key): \StoutLogic\AcfBuilder\FieldsBuilder
    {
        if (!isset(static::$instances[$key])) {
            static::$instances[$key] = new \StoutLogic\AcfBuilder\FieldsBuilder($key);
        }

        return static::$instances[$key];
    }
}
