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

Documentation is available at content.php

  1. <?php
  2. /**
  3. @version        $Id: content.php 6674 2007-02-19 05:52:03Z Jinx $
  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. // Include library dependencies
  19. jimport('joomla.filter.input');
  20.  
  21. /**
  22.  * Content table
  23.  *
  24.  * @package     Joomla.Framework
  25.  * @subpackage        Table
  26.  * @since    1.0
  27.  */
  28. class JTableContent extends JTable
  29. {
  30.     /** @var int Primary key */
  31.     var $id                    = null;
  32.     /** @var string */
  33.     var $title                = null;
  34.     /** @var string */
  35.     var $title_alias        = null;
  36.     /** @var string */
  37.     var $introtext            = null;
  38.     /** @var string */
  39.     var $fulltext            = null;
  40.     /** @var int */
  41.     var $state                = null;
  42.     /** @var int The id of the category section*/
  43.     var $sectionid            = null;
  44.     /** @var int DEPRECATED */
  45.     var $mask                = null;
  46.     /** @var int */
  47.     var $catid                = null;
  48.     /** @var datetime */
  49.     var $created            = null;
  50.     /** @var int User id*/
  51.     var $created_by            = null;
  52.     /** @var string An alias for the author*/
  53.     var $created_by_alias    = null;
  54.     /** @var datetime */
  55.     var $modified            = null;
  56.     /** @var int User id*/
  57.     var $modified_by        = null;
  58.     /** @var boolean */
  59.     var $checked_out        = 0;
  60.     /** @var time */
  61.     var $checked_out_time    = 0;
  62.     /** @var datetime */
  63.     var $frontpage_up        = null;
  64.     /** @var datetime */
  65.     var $frontpage_down        = null;
  66.     /** @var datetime */
  67.     var $publish_up            = null;
  68.     /** @var datetime */
  69.     var $publish_down        = null;
  70.     /** @var string */
  71.     var $images                = null;
  72.     /** @var string */
  73.     var $urls                = null;
  74.     /** @var string */
  75.     var $attribs            = null;
  76.     /** @var int */
  77.     var $version            = null;
  78.     /** @var int */
  79.     var $parentid            = null;
  80.     /** @var int */
  81.     var $ordering            = null;
  82.     /** @var string */
  83.     var $metakey            = null;
  84.     /** @var string */
  85.     var $metadesc            = null;
  86.     /** @var string */
  87.     var $metadata            = null;
  88.     /** @var int */
  89.     var $access                = null;
  90.     /** @var int */
  91.     var $hits                = null;
  92.  
  93.     /**
  94.     * @param database A database connector object
  95.     */
  96.     function __construct&$db {
  97.         parent::__construct'#__content''id'$db );
  98.     }
  99.  
  100.     /**
  101.      * Validation and filtering
  102.      */
  103.     function check()
  104.     {
  105.         /*
  106.         TODO: This filter is too rigorous,need to implement more configurable solution
  107.         // specific filters
  108.         $filter = & JInputFilter::getInstance( null, null, 1, 1 );
  109.         $this->introtext = trim( $filter->clean( $this->introtext ) );
  110.         $this->fulltext =  trim( $filter->clean( $this->fulltext ) );
  111.         */
  112.  
  113.         jimport('joomla.filter.output');
  114.         $alias JOutputFilter::stringURLSafe($this->title);
  115.  
  116.         if(empty($this->title_alias|| $this->title_alias === $alias {
  117.             $this->title_alias = $alias;
  118.         }
  119.  
  120.         if (trimstr_replace'&nbsp;'''$this->fulltext ) ) == ''{
  121.             $this->fulltext = '';
  122.         }
  123.  
  124.         return true;
  125.     }
  126.  
  127.     /**
  128.     * Converts record to XML
  129.     * @param boolean Map foreign keys to text values
  130.     */
  131.     function toXML$mapKeysToText=false )
  132.     {
  133.         $db =JFactory::getDBO();
  134.  
  135.         if ($mapKeysToText{
  136.             $query 'SELECT name'
  137.             . ' FROM #__sections'
  138.             . ' WHERE id = '$this->sectionid
  139.             ;
  140.             $db->setQuery$query );
  141.             $this->sectionid = $db->loadResult();
  142.  
  143.             $query 'SELECT name'
  144.             . ' FROM #__categories'
  145.             . ' WHERE id = '$this->catid
  146.             ;
  147.             $db->setQuery$query );
  148.             $this->catid = $db->loadResult();
  149.  
  150.             $query 'SELECT name'
  151.             . ' FROM #__users'
  152.             . ' WHERE id = ' $this->created_by
  153.             ;
  154.             $db->setQuery$query );
  155.             $this->created_by = $db->loadResult();
  156.         }
  157.  
  158.         return parent::toXML$mapKeysToText );
  159.     }
  160. }
  161. ?>

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