Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /joomla/database/table/category.php

Documentation is available at category.php

  1. <?php
  2. /**
  3. @version        $Id: category.php 6529 2007-02-08 06:57:00Z pasamio $
  4. @package        Joomla.Framework
  5. @subpackage    Table
  6. @copyright    Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
  7. @license        GNU/GPL, see LICENSE.php
  8. *  Joomla! is free software. This version may have been modified pursuant
  9. *  to the GNU General Public License, and as distributed it includes or
  10. *  is derivative of works licensed under the GNU General Public License or
  11. *  other free or open source software licenses.
  12. *  See COPYRIGHT.php for copyright notices and details.
  13. */
  14.  
  15. // Check to ensure this file is within the rest of the framework
  16. defined('JPATH_BASE'or die();
  17.  
  18. /**
  19.  * Category table
  20.  *
  21.  * @package     Joomla.Framework
  22.  * @subpackage        Table
  23.  * @since    1.0
  24.  */
  25. class JTableCategory extends JTable
  26. {
  27.     /** @var int Primary key */
  28.     var $id                    = null;
  29.     /** @var int */
  30.     var $parent_id            = null;
  31.     /** @var string The menu title for the Category (a short name)*/
  32.     var $title                = null;
  33.     /** @var string The full name for the Category*/
  34.     var $name                = null;
  35.     /** @var string */
  36.     var $image                = null;
  37.     /** @var string */
  38.     var $section            = null;
  39.     /** @var int */
  40.     var $image_position        = null;
  41.     /** @var string */
  42.     var $description        = null;
  43.     /** @var boolean */
  44.     var $published            = null;
  45.     /** @var boolean */
  46.     var $checked_out        = 0;
  47.     /** @var time */
  48.     var $checked_out_time    = 0;
  49.     /** @var int */
  50.     var $ordering            = null;
  51.     /** @var int */
  52.     var $access                = null;
  53.     /** @var string */
  54.     var $params                = null;
  55.  
  56.     /**
  57.     * @param database A database connector object
  58.     */
  59.     function __construct&$db 
  60.     {
  61.         parent::__construct'#__categories''id'$db );
  62.     }
  63.  
  64.     // overloaded check function
  65.         function check()
  66.     {
  67.         // check for valid name
  68.         if (trim$this->title == ''{
  69.             $this->_error = JText::sprintf'must contain a title'JText::_'Category') );
  70.             return false;
  71.         }
  72.         
  73.         // check for existing name
  74.         /*$query = 'SELECT id'
  75.         . ' FROM #__categories '
  76.         . ' WHERE title = "'.$this->title.'"'
  77.         . ' AND section = "'.$this->section.'"'
  78.         ;
  79.         $this->_db->setQuery( $query );
  80.  
  81.         $xid = intval( $this->_db->loadResult() );
  82.         if ($xid && $xid != intval( $this->id )) {
  83.             $this->_error = JText::sprintf( 'WARNNAMETRYAGAIN', JText::_( 'Category') );
  84.             return false;
  85.         }*/
  86.         
  87.         jimport('joomla.filter.output');
  88.         $alias JOutputFilter::stringURLSafe($this->title);
  89.         
  90.         if(empty($this->name|| $this->name === $alias {
  91.             $this->name = $alias;
  92.         }
  93.         
  94.         return true;
  95.     }
  96. }
  97. ?>

Documentation generated on Mon, 05 Mar 2007 20:53:55 +0000 by phpDocumentor 1.3.1