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

Documentation is available at module.php

  1. <?php
  2. /**
  3. @version        $Id: module.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.  * Module table
  20.  *
  21.  * @package     Joomla.Framework
  22.  * @subpackage        Table
  23.  * @since    1.0
  24.  */
  25. class JTableModule extends JTable
  26. {
  27.     /** @var int Primary key */
  28.     var $id                    = null;
  29.     /** @var string */
  30.     var $title                = null;
  31.     /** @var string */
  32.     var $showtitle            = null;
  33.     /** @var int */
  34.     var $content            = null;
  35.     /** @var int */
  36.     var $ordering            = null;
  37.     /** @var string */
  38.     var $position            = null;
  39.     /** @var boolean */
  40.     var $checked_out        = 0;
  41.     /** @var time */
  42.     var $checked_out_time    = 0;
  43.     /** @var boolean */
  44.     var $published            = null;
  45.     /** @var string */
  46.     var $module                = null;
  47.     /** @var int */
  48.     var $numnews            = null;
  49.     /** @var int */
  50.     var $access                = null;
  51.     /** @var string */
  52.     var $params                = null;
  53.     /** @var string */
  54.     var $iscore                = null;
  55.     /** @var string */
  56.     var $client_id            = null;
  57.     /** @var string */
  58.     var $control                = null;
  59.  
  60.     /**
  61.      * Contructore
  62.      *
  63.      * @access protected
  64.      * @param database A database connector object
  65.      */
  66.     function __construct&$db {
  67.         parent::__construct'#__modules''id'$db );
  68.     }
  69.  
  70.     /**
  71.     * Overloaded check function
  72.     *
  73.     * @access public
  74.     * @return boolean True if the object is ok
  75.     * @see JTable:bind
  76.     */
  77.     function check()
  78.     {
  79.         // check for valid name
  80.         if (trim$this->title == ''{
  81.             $this->_error = JText::sprintf'must contain a title'JText::_'Module') );
  82.             return false;
  83.         }
  84.  
  85.         // limitation has been removed
  86.         // check for existing title
  87.         //$this->_db->setQuery( 'SELECT id FROM #__modules'
  88.         //. ' WHERE title="'.$this->title.'"'
  89.         //);
  90.         // check for module of same name
  91.         //$xid = intval( $this->_db->loadResult() );
  92.         //if ($xid && $xid != intval( $this->id )) {
  93.         //    $this->_error = "There is a module already with that name, please try again.";
  94.         //    return false;
  95.         //}
  96.         return true;
  97.     }
  98.  
  99.     /**
  100.     * Overloaded bind function
  101.     *
  102.     * @access public
  103.     * @param array $hash named array
  104.     * @return null|string   null is operation was satisfactory, otherwise returns an error
  105.     * @see JTable:bind
  106.     * @since 1.5
  107.     */
  108.     function bind($array$ignore '')
  109.     {
  110.         if (is_array$array['params')) {
  111.             $registry new JRegistry();
  112.             $registry->loadArray($array['params']);
  113.             $array['params'$registry->toString();
  114.         }
  115.         if (isset$array['control'&& is_array$array['control')) {
  116.             $registry new JRegistry();
  117.             $registry->loadArray($array['control']);
  118.             $array['control'$registry->toString();
  119.         }
  120.  
  121.         return parent::bind($array$ignore);
  122.     }
  123. }
  124. ?>

Documentation generated on Mon, 05 Mar 2007 21:10:58 +0000 by phpDocumentor 1.3.1