the-art-of-joomla-archive /redirect/code/trunk/administrator/components/com_redirect/tables/link.php

Language PHP Lines 87
MD5 Hash 9015e13285cc175f2cbddc9156801c6b Estimated Cost $633 (why?)
Repository https://bitbucket.org/eddieajau/the-art-of-joomla-archive View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/**
 * @version		$Id: link.php 390 2010-11-05 11:35:33Z eddieajau $
 * @package		NewLifeInIT
 * @subpackage	com_redirect
 * @copyright	Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

defined('_JEXEC') or die;

jimport('joomla.database.table');

/**
 * Link Table for Redirect.
 *
 * @package		NewLifeInIT
 * @subpackage	com_redirect
 * @since		1.0
 */
class RedirectTableLink extends JTable
{
	/**
	 * @var int
	 */
	var $id = null;
	/**
	 * @var varchar
	 */
	var $old_url = null;
	/**
	 * @var varchar
	 */
	var $new_url = null;
	/**
	 * @var varchar
	 */
	var $comment = null;
	/**
	 * @var int unsigned
	 */
	var $published = null;
	/**
	 * @var int unsigned
	 */
	var $created_date = null;
	/**
	 * @var int unsigned
	 */
	var $updated_date = null;

	/**
	 * Constructor
	 *
	 * @param	object	Database object
	 * @return	void
	 * @since	1.0
	 */
	public function __construct(&$db)
	{
		parent::__construct('#__redirect_links', 'id', $db);
	}

	/**
	 * Overloaded check function.
	 *
	 * @return	boolean
	 * @since	1.0
	 */
	public function check()
	{
		// check for valid name
		if((trim($this->old_url)) == '') {
			$this->setError(JText::_('Must have a source URL'));
			return false;
		}
		// check for valid name
		if((trim($this->new_url)) == '') {
			$this->setError(JText::_('Must have a destination URL'));
			return false;
		}

		return true;
	}
}
Back to Top