<?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 ProducerQueryType
{
	/**
	 * @return array
	 */
	public static function config()
	{
		return [

			'fields' => [

				'producer' => [
					'type' => 'Producer',
					'args' => [
						'id' => [
							'type' => 'String',
						],
					],
					'metadata' => [
						'label' => 'Producer',
						'group' => 'DJ-Catalog2',
					],
					'extensions' => [
						'call' => __CLASS__ . '::resolve',
					],
				],

			],

		];


	}

	public static function resolve($root, array $args)
	{
		if (isset($root['item'])) {
			return $root['item'];
		}
	}
}
