<?php
/**
 * @version     1.3.3
 * @package     sellacious
 *
 * @copyright   Copyright (C) 2012-2017 Bhartiy Web Technologies. All rights reserved.
 * @license     SPL Sellacious Private License; see http://www.sellacious.com/spl.html
 * @author      Izhar Aazmi <info@bhartiy.com> - http://www.bhartiy.com
 */
// no direct access
defined('_JEXEC') or die;

JFormHelper::loadFieldClass('SQL');

/**
 * @class  JFormFieldEmailContext
 *
 */
class JFormFieldEmailContext extends JFormFieldSQL
{
	/**
	 * Method to get the custom field options.
	 * Use the query attribute to supply a query to generate the list.
	 *
	 * @return  array  The field option objects.
	 *
	 * @since   11.1
	 */
	protected function getOptions()
	{
		$this->query = JFactory::getDbo()->getQuery(true);
		$this->query->select('DISTINCT context')->from('#__sellacious_mailqueue')->order('context ASC');

		return parent::getOptions();
	}
}
