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/section.php

Documentation is available at section.php

  1. <?php
  2. /**
  3. @version        $Id: section.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.  * Section table
  20.  *
  21.  * @package     Joomla.Framework
  22.  * @subpackage        Table
  23.  * @since    1.0
  24.  */
  25. class JTableSection extends JTable
  26. {
  27.     /** @var int Primary key */
  28.     var $id                    = null;
  29.     /** @var string The menu title for the Section (a short name)*/
  30.     var $title                = null;
  31.     /** @var string The full name for the Section*/
  32.     var $name                = null;
  33.     /** @var string */
  34.     var $image                = null;
  35.     /** @var string */
  36.     var $scope                = null;
  37.     /** @var int */
  38.     var $image_position        = null;
  39.     /** @var string */
  40.     var $description        = null;
  41.     /** @var boolean */
  42.     var $published            = null;
  43.     /** @var boolean */
  44.     var $checked_out        = 0;
  45.     /** @var time */
  46.     var $checked_out_time    = 0;
  47.     /** @var int */
  48.     var $ordering            = null;
  49.     /** @var int */
  50.     var $access                = null;
  51.     /** @var string */
  52.     var $params                = null;
  53.  
  54.     /**
  55.     * @param database A database connector object
  56.     */
  57.     function __construct&$db {
  58.         parent::__construct'#__sections''id'$db );
  59.     }
  60.     // overloaded check function
  61.         function check()
  62.     {
  63.         // check for valid name
  64.         if (trim$this->title == ''{
  65.             $this->_error = JText::sprintf'must contain a title'JText::_'Section') );
  66.             return false;
  67.         }
  68.         
  69.         // check for existing name
  70.         /*$query = "SELECT id"
  71.         . ' FROM #__sections "
  72.         . ' WHERE title = "'. $this->title .'"'
  73.         . ' AND scope = "' . $this->scope .'"'
  74.         ;
  75.         $this->_db->setQuery( $query );
  76.  
  77.         $xid = intval( $this->_db->loadResult() );
  78.         if ($xid && $xid != intval( $this->id )) {
  79.             $this->_error = JText::sprintf( 'WARNNAMETRYAGAIN', JText::_( 'Section') );
  80.             return false;
  81.         }*/
  82.         
  83.         jimport('joomla.filter.output');
  84.         $alias JOutputFilter::stringURLSafe($this->title);
  85.         
  86.         if(empty($this->name|| $this->name === $alias {
  87.             $this->name = $alias;
  88.         }
  89.         
  90.         return true;
  91.     }
  92.  
  93.     /**
  94.     * Overloaded bind function
  95.     *
  96.     * @access public
  97.     * @param array $hash named array
  98.     * @return null|string   null is operation was satisfactory, otherwise returns an error
  99.     * @see JTable:bind
  100.     * @since 1.5
  101.     */
  102.     function bind($array$ignore '')
  103.     {
  104.         if (isset$array['params'&& is_array($array['params']))
  105.         {
  106.             $registry new JRegistry();
  107.             $registry->loadArray($array['params']);
  108.             $array['params'$registry->toString();
  109.         }
  110.  
  111.         return parent::bind($array$ignore);
  112.     }
  113. }
  114. ?>

Documentation generated on Mon, 05 Mar 2007 21:20:40 +0000 by phpDocumentor 1.3.1