| Server IP : 54.36.91.62 / Your IP : 216.73.217.94 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/administrator/components/com_jlexreview/libs/ |
Upload File : |
<?php
/**
* @package JLex Review
* @version 4.2.3
* @copyright Copyright (c) 2013-2018 JLexArt. All rights reserved
* @license GNU General Public License version 2 or later;
* @author www.jlexart.com
*/
defined('_JEXEC') or die;
class JLexReviewImportAdapter
{
public $total = 0;
public $section_file = 0;
public $review_field = 0;
protected $model = null;
public function insert_row($data)
{
$table = JTable::getInstance('Review', 'TableJR');
// check entry exist or not.
$entry = JTable::getInstance('Object', 'TableJR');
$entry->load(array(
'object' => $data['object'],
'object_id' => $data['object_id']
));
if(!$entry->id)
{
$entry->bind (array(
'object_name' => $data['object_name'],
'object' => $data['object'],
'object_id' => $data['object_id'],
'section_file' => $this->section_file,
'created_by' => JFactory::getUser()->id,
'url' => $data['object_url']
));
if(isset($data['section_id']))
{
$entry->set('section_id', $data['section_id']);
}
$entry->check();
$entry->store();
}
if(!$entry->id) return false;
// unset some variables
unset($data['object_name']);
unset($data['object']);
unset($data['object_id']);
unset($data['section_id']);
unset($data['object_url']);
if(!$this->model)
{
$this->model = JModelLegacy::getInstance('Rating', 'JLexReviewModel');
}
$data['form_id'] = $this->section_file;
$data['entry_id'] = $entry->id;
if(@$data['rating']==0) $data['rating']=5;
$data['fields'] = array();
$data['fields'][$this->review_field] = $data['review'];
$data['user_type'] = $data['created_by']>0?1:0;
if(!isset($data['title']))
{
$data['title'] = JLexReviewHelperAdmin::subwords($data['review'],10);
}
$return = $this->model->save($data);
return $return;
}
public function setParams($name, $value)
{
$this->$name = $value;
}
}