Current File : /home/pacjaorg/public_html/km/administrator/components/com_djcfimporter/tables/items.php |
<?php
/**
* @version $Id: groups.php 30 2015-02-25 16:01:31Z michal $
* @package DJ-Reviews
* @copyright Copyright (C) 2014 DJ-Extensions.com LTD, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*
* DJ-Reviews is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DJ-Reviews is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DJ-Reviews. If not, see <http://www.gnu.org/licenses/>.
*
*/
defined('_JEXEC') or die('Restricted access');
class DJCFImporterTableItems extends JTable
{
public function __construct(&$db)
{
parent::__construct('#__djcfi_items', 'id', $db);
}
function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params'])) {
$registry = new JRegistry();
$registry->loadArray($array['params']);
$array['params'] = (string)$registry;
}
return parent::bind($array, $ignore);
}
public function store($updateNulls = false)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
$app = JFactory::getApplication();
$db = JFactory::getDbo();
if (!$this->id) {
if (!intval($this->created)) {
$this->created = $date->toSql();
}
if (empty($this->created_by)) {
$this->created_by = $user->get('id');
}
}
$table = JTable::getInstance('Items', 'DJCFImporterTable');
if ($table->load(array('name'=>$this->name)) && $app->input->get('task') == 'save2copy') {
$this->name .= ' (copy)';
}
return parent::store($updateNulls);
}
}