| Current Path : /home/bonneesp/www/administrator/components/com_icagenda/utilities/categories/ |
| Current File : /home/bonneesp/www/administrator/components/com_icagenda/utilities/categories/categories.php |
<?php
/**
*------------------------------------------------------------------------------
* iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
*------------------------------------------------------------------------------
* @package iCagenda
* @subpackage utilities
* @copyright Copyright (c)2012-2021 Cyril Rezé, Jooml!C - All rights reserved
*
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author Cyril Rezé (Lyr!C)
* @link http://www.joomlic.com
*
* @version 3.4.0 2014-05-12
* @since 3.4.0
*------------------------------------------------------------------------------
*/
// No direct access to this file
defined('_JEXEC') or die();
/**
* class icagendaCategories
*/
class icagendaCategories
{
/**
* Function to return list of categories
*
* @access public static
* @param $state (if not defined, state is published ('1'))
* @return list array of categories
*
* @since 1.0.0
*/
static public function getList($state = null)
{
$state = $state ? (int) $state : '1';
// Preparing connection to db
$db = JFactory::getDbo();
// Preparing the query
$query = $db->getQuery(true);
$query->select('c.color AS color, c.title AS title')
->from('#__icagenda_category AS c');
$query->where('c.state = ' . (int) $state);
$db->setQuery($query);
$list = $db->loadObjectList();
if ($list)
{
return $list;
}
return false;
}
}