| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 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/c/o/o/coopiak/amisdesseniors-fr/nice/libraries/kunena/src/Tables/ |
Upload File : |
<?php
/**
* Kunena Component
*
* @package Kunena.Framework
* @subpackage Tables
*
* @copyright Copyright (C) 2008 - @currentyear@ Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
namespace Kunena\Forum\Libraries\Tables;
\defined('_JEXEC') or die();
use Exception;
use Joomla\CMS\Language\Text;
use Joomla\Database\DatabaseDriver;
use Kunena\Forum\Libraries\Forum\Topic\KunenaTopicHelper;
use Kunena\Forum\Libraries\User\KunenaUserHelper;
use RuntimeException;
/**
* Kunena User Read Table
* Provides access to the #__kunena_user_read table
*
* @since Kunena 6.0
*/
class KunenaUserRead extends KunenaTable
{
/**
* @var null
* @since Kunena 6.0
*/
public $user_id = null;
/**
* @var null
* @since Kunena 6.0
*/
public $topic_id = null;
/**
* @var null
* @since Kunena 6.0
*/
public $categoryId = null;
/**
* @var null
* @since Kunena 6.0
*/
public $message_id = null;
/**
* @var null
* @since Kunena 6.0
*/
public $time = null;
/**
* @param DatabaseDriver $db Database driver
*
* @since Kunena 6.0
*/
public function __construct(DatabaseDriver $db)
{
parent::__construct('#__kunena_user_read', ['user_id', 'topic_id'], $db);
}
/**
* @return boolean
*
* @since Kunena 6.0
*
* @throws Exception
*/
public function check(): bool
{
$user = KunenaUserHelper::get($this->user_id);
$topic = KunenaTopicHelper::get($this->topic_id);
if (!$user->exists()) {
throw new RuntimeException(Text::sprintf('COM_KUNENA_LIB_TABLE_USERTOPICS_ERROR_USER_INVALID', (int) $user->userid));
}
if (!$topic->exists()) {
throw new RuntimeException(Text::sprintf('COM_KUNENA_LIB_TABLE_USERTOPICS_ERROR_TOPIC_INVALID', (int) $topic->id));
}
$this->category_id = $topic->category_id;
return true;
}
}