Your IP : 216.73.216.240


Current Path : /home/juvelize/www/administrator/components/com_ffgate/models/
Upload File :
Current File : /home/juvelize/www/administrator/components/com_ffgate/models/site.php

<?php
/**
 * @package    FFGate
 * @author     Yves Hoppe <yves@compojoom.com>
 * @date       26.11.13
 *
 * @copyright  Copyright (C) 2008 - 2013 compojoom.com - Yves Hoppe. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.modeladmin');

/**
 * Class FFGateModelSite
 *
 * @since  1.0.0
 */
class FFGateModelSite extends JModelAdmin
{
	/**
	 * Gets the table for the model
	 *
	 * @param   string  $name     - The name
	 * @param   string  $prefix   - The prefix
	 * @param   array   $options  - The options
	 *
	 * @return  JTable|mixed
	 */
	public function getTable($name = 'Sites', $prefix = 'FFgateTable', $options = array())
	{
		return JTable::getInstance($name, $prefix, $options);
	}

	/**
	 * Gets the form
	 *
	 * @param   array  $data  - The data
	 * @param   bool   $load  - Load
	 *
	 * @return  mixed
	 */
	public function getForm($data = array(), $load = true)
	{
		$form = $this->loadForm('com_ffgate.site', 'site', array('control' => 'jform', 'load_data' => $load));

		return $form;
	}

	/**
	 * Loads the form data
	 *
	 * @return  array|mixed
	 */
	public function loadFormData()
	{
		$data = JFactory::getApplication()->getUserState('com_ffgate.edit.site.data', array());

		if (empty($data))
		{
			$data = $this->getItem();
		}

		return $data;
	}
}