Version 1.1.0 released
git-svn-id: svn://p-o.co.uk/p-o.co.uk/com_ajaxdemo@60 60e5ea7b-c093-dd11-ac13-000423648166
This commit is contained in:
52
site/models/colours.php
Normal file
52
site/models/colours.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Ajax demonstration component
|
||||
*
|
||||
* PHP version 5.3
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @copyright 2010-2012 Persistent Objects Ltd
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die();
|
||||
|
||||
jimport('joomla.application.component.modellist');
|
||||
|
||||
/**
|
||||
* Model for Ajax demonstration
|
||||
*
|
||||
* @category Joomla_Component
|
||||
* @package Com_Ajaxdemo
|
||||
* @author Alan Hicks <ahicks@p-o.co.uk>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @link http://p-o.co.uk/
|
||||
*/
|
||||
class AjaxdemoModelColours extends JModelList
|
||||
{
|
||||
/**
|
||||
* Returns list query
|
||||
*
|
||||
* @return string sql list query
|
||||
*/
|
||||
protected function getListQuery()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('s.id, c.id as colour_id, s.ordering, s.published');
|
||||
$query->select('s.featured, s.title, s.alias, c.thumbnail_image, s.notes');
|
||||
$query->from('#__ajaxdemo_colours s');
|
||||
$query->innerjoin('#__ajaxdemo_colour c ON s.id = c.colour_id ');
|
||||
$query->where('s.published = 1 AND s.featured = 1');
|
||||
$query->where('c.published = 1 AND c.dflt = 1');
|
||||
$query->order('s.ordering asc');
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user