/exchange/code/trunk/administrator/components/com_exchange/helpers/catalog.php
PHP | 38 lines | 23 code | 2 blank | 13 comment | 5 complexity | 8f1072d98288dcef136cbd02c7353454 MD5 | raw file
- <?php
- /**
- * @version $Id: catalog.php 280 2010-09-18 02:14:15Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_exchange
- * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License version 2 or later.
- * @link http://www.theartofjoomla.com
- */
- // no direct access
- defined('_JEXEC') or die;
- /**
- * @package NewLifeInIT
- * @subpackage com_exchange
- */
- function lookupTaxonId($value, $typeId, $log = false)
- {
- if (($value != '') and ($typeId != ''))
- {
- $db = JFactory::getDBO();
- $clean = trim(strtolower($value));
- $query = 'SELECT id' .
- ' FROM #__jxcatalog_taxa' .
- ' WHERE title = '.$db->Quote($clean) .
- ' AND type_id = '.(int) $typeId;
- $db->setQuery($query);
- $data = $db->loadResult();
- if ($log) {
- ExchangeLog::add(200, $db->getQuery());
- }
- return $data;
- }
- else {
- return null;
- }
- }