Source for file viewlevel.php

Documentation is available at viewlevel.php

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

Documentation generated on Tue, 19 Nov 2013 15:18:17 +0100 by phpDocumentor 1.4.3