?
Path : /home/admin/public_html/old/board/tmp/install_52baa401645d2/admin/tables/ |
Current File : /home/admin/public_html/old/board/tmp/install_52baa401645d2/admin/tables/joomgalleryorphans.php |
<?php // $HeadURL: https://joomgallery.org/svn/joomgallery/JG-2.0/JG/trunk/administrator/components/com_joomgallery/tables/joomgalleryorphans.php $ // $Id: joomgalleryorphans.php 4276 2013-05-23 11:05:11Z chraneco $ /****************************************************************************************\ ** JoomGallery 2 ** ** By: JoomGallery::ProjectTeam ** ** Copyright (C) 2008 - 2012 JoomGallery::ProjectTeam ** ** Based on: JoomGallery 1.0.0 by JoomGallery::ProjectTeam ** ** Released under GNU GPL Public License ** ** License: http://www.gnu.org/copyleft/gpl.html or have a look ** ** at administrator/components/com_joomgallery/LICENSE.TXT ** \****************************************************************************************/ defined('_JEXEC') or die('Direct Access to this location is not allowed.'); /** * JoomGallery maintenance table class * * @package JoomGallery * @since 1.5.5 */ class TableJoomgalleryOrphans extends JTable { /** @var int Primary key */ var $id = null; /** @var string */ var $fullpath = null; /** @var string */ var $type = null; /** @var int */ var $refid = null; /** @var string */ var $title = null; function TableJoomgalleryOrphans(&$db) { parent::__construct(_JOOM_TABLE_ORPHANS, 'id', $db); } function reorderAll() { $query = 'SELECT DISTINCT catid FROM '.$this->_db->nameQuote($this->_tbl); $this->_db->setQuery($query); $catids = $this->_db->loadResultArray(); foreach($catids as $catid) { $this->reorder('catid = '.$catid); } } /** * Returns the ordering value to place a new item first in its group * * @access public * @param string query WHERE clause for selecting MAX(ordering). * @return int the ordring number */ function getPreviousOrder($where = '') { if(!in_array('ordering', array_keys($this->getProperties()))) { $this->setError(get_class($this).' does not support ordering'); return false; } $query = 'SELECT MIN(ordering)' . ' FROM ' . $this->_tbl . ($where ? ' WHERE '.$where : ''); $this->_db->setQuery($query); $maxord = $this->_db->loadResult(); if($this->_db->getErrorNum()) { $this->setError($this->_db->getErrorMsg()); return false; } return $maxord - 1; } }