[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/libraries/joomla/database/table/ -> viewlevel.php (source)

   1  <?php
   2  /**
   3   * @package     Joomla.Platform
   4   * @subpackage  Database
   5   *
   6   * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   7   * @license     GNU General Public License version 2 or later; see LICENSE
   8   */
   9  
  10  defined('JPATH_PLATFORM') or die;
  11  
  12  jimport('joomla.database.table');
  13  
  14  /**
  15   * Viewlevels table class.
  16   *
  17   * @package     Joomla.Platform
  18   * @subpackage  Database
  19   * @since       11.1
  20   */
  21  class JTableViewlevel extends JTable
  22  {
  23      /**
  24       * Constructor
  25       *
  26       * @param   JDatabase  &$db  Database object.
  27       *
  28       * @since   11.1
  29       */
  30  	public function __construct(&$db)
  31      {
  32          parent::__construct('#__viewlevels', 'id', $db);
  33      }
  34  
  35      /**
  36       * Method to bind the data.
  37       *
  38       * @param   array  $array   The data to bind.
  39       * @param   mixed  $ignore  An array or space separated list of fields to ignore.
  40       *
  41       * @return  boolean  True on success, false on failure.
  42       *
  43       * @since   11.1
  44       */
  45  	public function bind($array, $ignore = '')
  46      {
  47          // Bind the rules as appropriate.
  48          if (isset($array['rules']))
  49          {
  50              if (is_array($array['rules']))
  51              {
  52                  $array['rules'] = json_encode($array['rules']);
  53              }
  54          }
  55  
  56          return parent::bind($array, $ignore);
  57      }
  58  
  59      /**
  60       * Method to check the current record to save
  61       *
  62       * @return  boolean  True on success
  63       *
  64       * @since   11.1
  65       */
  66  	public function check()
  67      {
  68          // Validate the title.
  69          if ((trim($this->title)) == '')
  70          {
  71              $this->setError(JText::_('JLIB_DATABASE_ERROR_VIEWLEVEL'));
  72              return false;
  73          }
  74  
  75          return true;
  76      }
  77  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1