Source for file update.php

Documentation is available at update.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.  * Update table
  14.  * Stores updates temporarily
  15.  *
  16.  * @package     Joomla.Platform
  17.  * @subpackage  Table
  18.  * @since       11.1
  19.  */
  20. class JTableUpdate extends JTable
  21. {
  22.     /**
  23.      * Constructor
  24.      *
  25.      * @param   JDatabaseDriver  $db  Database driver object.
  26.      *
  27.      * @since   11.1
  28.      */
  29.     public function __construct(JDatabaseDriver $db)
  30.     {
  31.         parent::__construct('#__updates''update_id'$db);
  32.     }
  33.  
  34.     /**
  35.      * Overloaded check function
  36.      *
  37.      * @return  boolean  True if the object is ok
  38.      *
  39.      * @see     JTable::check()
  40.      * @since   11.1
  41.      */
  42.     public function check()
  43.     {
  44.         // Check for valid name
  45.         if (trim($this->name== '' || trim($this->element== '')
  46.         {
  47.             $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION'));
  48.  
  49.             return false;
  50.         }
  51.         return true;
  52.     }
  53.  
  54.     /**
  55.      * Overloaded bind function
  56.      *
  57.      * @param   array  $array   Named array
  58.      * @param   mixed  $ignore  An optional array or space separated list of properties
  59.      *                           to ignore while binding.
  60.      *
  61.      * @return  mixed  Null if operation was satisfactory, otherwise returns an error
  62.      *
  63.      * @see     JTable::bind()
  64.      * @since   11.1
  65.      */
  66.     public function bind($array$ignore '')
  67.     {
  68.         if (isset($array['params']&& is_array($array['params']))
  69.         {
  70.             $registry new JRegistry;
  71.             $registry->loadArray($array['params']);
  72.             $array['params'= (string) $registry;
  73.         }
  74.  
  75.         if (isset($array['control']&& is_array($array['control']))
  76.         {
  77.             $registry new JRegistry;
  78.             $registry->loadArray($array['control']);
  79.             $array['control'= (string) $registry;
  80.         }
  81.  
  82.         return parent::bind($array$ignore);
  83.     }
  84.  
  85.     /**
  86.      * Method to create and execute a SELECT WHERE query.
  87.      *
  88.      * @param   array  $options  Array of options
  89.      *
  90.      * @return  string  Results of query
  91.      *
  92.      * @since   11.1
  93.      */
  94.     public function find($options array())
  95.     {
  96.         $where array();
  97.  
  98.         foreach ($options as $col => $val)
  99.         {
  100.             $where[$col ' = ' $this->_db->quote($val);
  101.         }
  102.  
  103.         $query $this->_db->getQuery(true)
  104.             ->select($this->_db->quoteName($this->_tbl_key))
  105.             ->from($this->_db->quoteName($this->_tbl))
  106.             ->where(implode(' AND '$where));
  107.         $this->_db->setQuery($query);
  108.  
  109.         return $this->_db->loadResult();
  110.     }
  111. }

Documentation generated on Tue, 19 Nov 2013 15:16:08 +0100 by phpDocumentor 1.4.3