Current File : /home/pacjaorg/public_html/km/administrator/components/com_djclassifieds/models/itemsunit.php
<?php
/**
 * @package DJ-Classifieds
 * @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
 */

defined('_JEXEC') or die;

class DjclassifiedsModelItemsunit extends DJClassifiedsAdminModel
{
	public function __construct($config = array())
	{
		$config['event_after_save'] = 'onDJClassifiedsModelAdminAfterSave';
		$config['event_after_delete'] = 'onDJClassifiedsModelAdminAfterDelete';
		parent::__construct($config);
	}

	public function getTable($type = 'Itemsunits', $prefix = 'DjclassifiedsTable', $config = array())
	{
		return JTable::getInstance($type, $prefix, $config);
	}
	
	public function getForm($data = array(), $loadData = true)
	{
		// Initialise variables.
		$app	= JFactory::getApplication();

		// Get the form.
		$form = $this->loadForm('com_djclassifieds.itemsunit', 'itemsunit', array('control' => 'jform', 'load_data' => $loadData));
		if (empty($form)) {
			return false;
		}
		return $form;
	}

	protected function loadFormData()
	{
		$data = JFactory::getApplication()->getUserState('com_djclassifieds.edit.itemsunit.data', array());

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

		return $data;
	}
	
	protected function preprocessForm(JForm $form, $data, $group = 'djclassifiedsitemsunit')
	{
		return parent::preprocessForm($form, $data, $group);
	}

	protected function prepareTable($table)
	{
		$db = JFactory::getDbo();

		$table->name		= htmlspecialchars_decode($table->name, ENT_QUOTES);
		
		if (empty($table->id)) {
			if (empty($table->ordering)) {
				$db->setQuery('SELECT MAX(ordering) FROM #__djcf_items_units');
				$max = $db->loadResult();
		
				$table->ordering = $max+1;
			}
		}
	}

	protected function getReorderConditions($table = null)
	{
		$condition = array();
		return $condition;
	}

}
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!