<?php
namespace Prodigy\Includes\Models;

use Prodigy\Includes\Prodigy;

/**
 * Class Brands model
 */
class Prodigy_Brands {

	public const META_TERM_GROUP = 3;
	public const BRAND_PREFIX    = 'prodigy_brands_';

	/**
	 * @param string $name
	 * @param string $slug
	 *
	 * @return void
	 */
	public function add( string $name, string $slug ): void {
		if ( empty( term_exists( $name, Prodigy::get_prodigy_brand_type() ) ) ) {
			wp_insert_term(
				$name,
				Prodigy::get_prodigy_brand_type(),
				array(
					'slug'       => $slug,
					'term_group' => self::META_TERM_GROUP,
				)
			);
		}
	}
}
