<?php
/**
 * @package	RSMembership!
 * @copyright	(c) 2009 - 2016 RSJoomla!
 * @link		https://www.rsjoomla.com
 * @license	GNU General Public License http://www.gnu.org/licenses/gpl-3.0.en.html
 */
defined('_JEXEC') or die('Restricted access');

class RSMembershipTableMembership_Field extends JTable
{
	public function __construct(& $db) 
	{
		parent::__construct('#__rsmembership_membership_fields', 'id', $db);
	}

	public function check()
	{
		$this->name = JFilterOutput::stringURLSafe($this->name);

		if (!$this->id)
			$this->ordering = $this->getNextOrder($this->_db->qn('membership_id').' = '.$this->_db->q($this->membership_id));

		return true;
	}
}