<?php
/**
 * @package DJ-Catalog2-Yootheme
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 */

namespace DJExtensions\DJCatalog2\YOOtheme\Builder\Source\Type\Producer;
defined('_JEXEC') or die;
class ProducerCategoryQueryType
{
	/**
	 * @return array
	 */
	public static function config()
	{
		return [

			'fields' => [

				'singleproducercategory' => [
					'type' => 'ProducerCategory',
					'metadata' => [
						'label' => 'Producer Category',
						'group' => 'Page',
					],
					'extensions' => [
						'call' => __CLASS__ . '::resolve',
					],
				],

			],

		];
	}

	public static function resolve($root)
	{
		if (isset($root['producercategory'])) {
			return $root['producercategory'];
		}
	}
}