| 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/coopiak/amisdesseniors-fr/nice/libraries/kunena/src/Forum/Message/Karma/ |
Upload File : |
<?php
/**
* Kunena Component
*
* @package Kunena.Framework
* @subpackage Forum.Message
*
* @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\Forum\Message\Karma;
\defined('_JEXEC') or die();
use Exception;
/**
* Kunena Forum Topic Karma Helper Class
*
* @since 6.2
*/
abstract class KunenaKarmaHelper
{
/**
* @var array
* @since Kunena 6.2
*/
protected static $_instances = [];
/**
* Returns \Kunena\Forum\Libraries\Forum\Topic\TopicRate object
*
* @access public
*
* @internal param The $identifier rate object to load - Can be only an integer.
*
* @param bool $reload reload
*
* @param null $identifier identifier
*
* @return KunenaKarma The rate object.
*
* @since Kunena 6.2
*
* @throws Exception
*/
public static function get($identifier = null, $reload = false): KunenaKarma
{
if ($identifier instanceof KunenaKarma) {
return $identifier;
}
$id = \intval($identifier);
if ($id < 1) {
return new KunenaKarma();
}
if ($reload || empty(self::$_instances [$id])) {
self::$_instances [$id] = new KunenaKarma($id);
}
return self::$_instances [$id];
}
}