1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Table
5 *
6 * @copyright Copyright (C) 2005 - 2017 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 site table
14 * Stores the update sites for extensions
15 *
16 * @package Joomla.Platform
17 * @subpackage Table
18 * @since 3.4
19 */
20 class JTableUpdatesite extends JTable
21 {
22 /**
23 * Constructor
24 *
25 * @param JDatabaseDriver $db Database driver object.
26 *
27 * @since 3.4
28 */
29 public function __construct($db)
30 {
31 parent::__construct('#__update_sites', 'update_site_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 3.4
41 */
42 public function check()
43 {
44 // Check for valid name
45 if (trim($this->name) == '' || trim($this->location) == '')
46 {
47 $this->setError(JText::_('JLIB_DATABASE_ERROR_MUSTCONTAIN_A_TITLE_EXTENSION'));
48
49 return false;
50 }
51
52 return true;
53 }
54 }
55