| Current Path : /var/www/components/com_contactpush/models/ |
| Current File : /var/www/components/com_contactpush/models/thirduser.php |
<?php
/** ______________________________________________
* o O | |
* ((((( o < Generated with Cook Self Service V3.1 |
* ( o o ) |______________________________________________|
* --------oOOO-----(_)-----OOOo---------------------------------- www.j-cook.pro --- +
* @version 1.0.0
* @package Contact Push
* @subpackage Users
* @copyright Netamity 2017
* @author Andy Hickey - www.netamity.com - andy@netamity.com
* @license GPL V2+
*
* .oooO Oooo.
* ( ) ( )
* -------------\ (----) /----------------------------------------------------------- +
* \_) (_/
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
/**
* Contactpush Item Model
*
* @package Contactpush
* @subpackage Classes
*/
class ContactpushCkModelThirduser extends ContactpushClassModelItem
{
/**
* View list alias
*
* @var string
*/
protected $view_item = 'thirduser';
/**
* View list alias
*
* @var string
*/
protected $view_list = 'thirdusers';
/**
* Constructor
*
* @access public
* @param array $config An optional associative array of configuration settings.
*
* @return void
*/
public function __construct($config = array())
{
parent::__construct();
}
/**
* Returns a Table object, always creating it.
*
* @access public
* @param string $type The table type to instantiate.
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
*
* @since 1.6
*
* @return JTable A database object
*/
public function getTable($type = 'thirduser', $prefix = 'ContactpushTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Preparation of the item query.
*
* @access protected
* @param object &$query returns a filled query object.
* @param integer $pk The primary id key of the user
*
* @return void
*/
protected function prepareQuery(&$query, $pk)
{
//FROM : Main table
$query->from('#__users AS a');
// Primary Key is always required
$this->addSelect('a.id');
switch($this->getState('context', 'all'))
{
case 'all':
//SELECT : raw complete query without joins
$this->addSelect('a.*');
// Disable the pagination
$this->setState('list.limit', null);
$this->setState('list.start', null);
// Item search : Based on Primary Key
$query->where('a.id = ' . (int) $pk);
break;
}
// ORDERING
$orderCol = $this->getState('list.ordering');
$orderDir = $this->getState('list.direction', 'ASC');
if ($orderCol)
$this->addOrder($orderCol . ' ' . $orderDir);
// Apply all SQL directives to the query
$this->applySqlStates($query);
}
}
// Load the fork
ContactpushHelper::loadFork(__FILE__);
// Fallback if no fork has been found
if (!class_exists('ContactpushModelThirduser')){ class ContactpushModelThirduser extends ContactpushCkModelThirduser{} }