<?php
declare(strict_types=1);

namespace AuxCF\Services;

use AuxCF\Entities\FieldGroupEntity;

/**
 * Utilities for working with field groups
 * @since 1.0.0
 */
class FieldGroupService
{
  /**
   * Get the full documentation URL for an AUX component field group
   * @since 1.0.0
   * @uses \AuxCF\Entities\FieldGroupEntity::$documentationPath
   * @uses \AuxCF::DOCUMENTATION_BASE
   */
  public static function documentationUrl(FieldGroupEntity $fieldGroup): string
  {
    if (!$fieldGroup::$documentationPath) {
      return '';
    }

    return \AuxCF::DOCUMENTATION_BASE . $fieldGroup::$documentationPath;
  }
}
