| Server IP : 54.36.91.62 / Your IP : 216.73.217.117 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/tables/ |
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 TableJRObject extends JTable
{
public $id = null;
public $object_name = null;
public $object = null;
public $object_id = null;
public $section_id = null;
public $section_file = null;
public $created_by = null;
public $published = null;
public $rating = null;
public $count_rating = null;
public $count_image = null;
public $count_review = null;
public $count_all_rating = null;
public $count_all_review = null;
public $latest_time = null;
public $latest_id = null;
public $editor_mode = null;
public $editor_content = null;
public $extra_content = null;
public $schema = null;
public $editor_rating = null;
public $url = null;
public $url2post = null;
public $canonical = null;
public $params = null;
public function __construct(&$db)
{
parent::__construct('#__jlexreview_entry', 'id', $db);
}
public function check()
{
if(!preg_match("/[A-z0-9\-\_]+/i", $this->object))
{
$this->setError(JText::_("JR_OBJECT_VALID_CHARACTERS"));
return false;
}
if(!preg_match("/[A-z0-9\-\_]+/i", $this->object_id))
{
$this->setError(JText::_("JR_OBJECT_ID_VALID_CHARACTERS"));
return false;
}
// check item is exist or not
$query = $this->_db->getQuery(true);
$query->select("id")
->from("#__jlexreview_entry")
->where([
$this->_db->quoteName("object")."=".$this->_db->quote($this->object),
$this->_db->quoteName("object_id")."=".$this->_db->quote($this->object_id)
]);
$exist = $this->_db->setQuery($query)->loadResult();
if($exist>0 && $this->id!=$exist)
{
$this->setError(JText::_("JR_THE_ITEM_NOT_FOUND"));
return false;
}
if(preg_match("/^https?:\/\//i", $this->url))
{
$this->setError(JText::_("JR_URL_MUST_BE_RELATIVE_URL"));
return false;
}
$this->params = json_encode($this->params);
return true;
}
public function delete($pk=null)
{
if($this->id<1) return false;
if(!parent::delete($pk)) return false;
// delete all review of this entry item
$tables = ["#__jlexreview", "#__jlexreview_attachment", "#__jlexreview_cm"];
$query = $this->_db->getQuery(true);
foreach($tables as $tb)
{
$query->clear()
->delete($tb)
->where("entry_id=".$this->_db->quote($this->id));
$this->_db->setQuery($query)->execute();
}
return true;
}
}