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

Documentation is available at component.php

  1. <?php
  2. /**
  3. @version        $Id: component.php 6472 2007-02-03 10:47:26Z 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.  * Component table
  20.  *
  21.  * @package     Joomla.Framework
  22.  * @subpackage        Table
  23.  * @since    1.0
  24.  */
  25. class JTableComponent extends JTable
  26. {
  27.     /** @var int Primary key */
  28.     var $id                    = null;
  29.     /** @var string */
  30.     var $name                = null;
  31.     /** @var string */
  32.     var $link                = null;
  33.     /** @var int */
  34.     var $menuid                = null;
  35.     /** @var int */
  36.     var $parent                = null;
  37.     /** @var string */
  38.     var $admin_menu_link    = null;
  39.     /** @var string */
  40.     var $admin_menu_alt        = null;
  41.     /** @var string */
  42.     var $option                = null;
  43.     /** @var string */
  44.     var $ordering            = null;
  45.     /** @var string */
  46.     var $admin_menu_img        = null;
  47.     /** @var int */
  48.     var $iscore                = null;
  49.     /** @var string */
  50.     var $params                = null;
  51.     /** @var int */
  52.     var $enabled            = null;
  53.  
  54.     /**
  55.     * @param database A database connector object
  56.     */
  57.     function __construct&$db {
  58.         parent::__construct'#__components''id'$db );
  59.     }
  60.  
  61.     /**
  62.      * Loads a data row by option
  63.      * @param string The component option value
  64.      * @return boolean 
  65.      */
  66.     function loadByOption$option )
  67.     {
  68.         $db &$this->getDBO();
  69.         $query 'SELECT id' .
  70.                 ' FROM #__components' .
  71.                 ' WHERE ' $db->nameQuote'option' '=' $db->Quote$option .
  72.                 ' AND parent = 0';
  73.         $db->setQuery$query0);
  74.         $id $db->loadResult();
  75.  
  76.         if ($id === null)
  77.         {
  78.             return false;
  79.         }
  80.         else
  81.         {
  82.             return $this->load$id );
  83.         }
  84.     }
  85.     /**
  86.      * Validate and filter fields
  87.      */
  88.     function check({
  89.         $this->parent = intval$this->parent );
  90.         $this->ordering = intval$this->ordering );
  91.         return true;
  92.     }
  93.  
  94.     /**
  95.     * Overloaded bind function
  96.     *
  97.     * @access public
  98.     * @param array $hash named array
  99.     * @return null|string   null is operation was satisfactory, otherwise returns an error
  100.     * @see JTable:bind
  101.     * @since 1.5
  102.     */
  103.     function bind($array$ignore '')
  104.     {
  105.         if (is_array$array['params')) {
  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 20:54:45 +0000 by phpDocumentor 1.3.1