<commit_before><?php
namespace wcf\data\user\trophy;
use wcf\data\trophy\Trophy;
use wcf\data\trophy\TrophyCache;
use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObject;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
use wcf\util\StringUtil;

/**
 * Represents a user trophy.
 *
 * @author	<NAME>
 * @copyright	2001-2017 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Data\User\Trophy
 * @since	3.1
 *
 * @property-read	integer		$userTrophyID			unique id of the user trophy
 * @property-read	integer		$trophyID			trophy id
 * @property-read	integer		$userID				user id
 * @property-read	integer		$time				the time when the trophy was rewarded
 * @property-read	string		$description			the custom trophy description
 * @property-read	string		$useCustomDescription		`1`, iif the trophy use a custom description
 */
class UserTrophy extends DatabaseObject {
	/**
	 * The description text replacements. 
	 * @var string[]
	 */
	private $replacements; 
	
	/**
	 * Returns the trophy for the user trophy. 
	 * 
	 * @return Trophy
	 */
	public function getTrophy() {
		return TrophyCache::getInstance()->getTrophyByID($this->trophyID);
	}
	
	/**
	 * Returns the user profile for the user trophy.
	 *<commit_msg>Fix $databaseTableIndexName for UserTrophy<commit_after><?php
namespace wcf\data\user\trophy;
use wcf\data\trophy\Trophy;
use wcf\data\trophy\TrophyCache;
use wcf\data\user\User;
use wcf\data\user\UserProfile;
use wcf\data\DatabaseObject;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
use wcf\system\WCF;
use wcf\util\StringUtil;

/**
 * Represents a user trophy.
 *
 * @author	<NAME>
 * @copyright	2001-2017 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\Data\User\Trophy
 * @since	3.1
 *
 * @property-read	integer		$userTrophyID			unique id of the user trophy
 * @property-read	integer		$trophyID			trophy id
 * @property-read	integer		$userID				user id
 * @property-read	integer		$time				the time when the trophy was rewarded
 * @property-read	string		$description			the custom trophy description
 * @property-read	string		$useCustomDescription		`1`, if the trophy use a custom description
 */
class UserTrophy extends DatabaseObject {
	/**
	 * @inheritDoc
	 */
	protected static $databaseTableIndexName = 'userTrophyID';
	
	/**
	 * The description text replacements. 
	 * @var string[]
	 */
	private $replacements; 
	
	/**
	 * Returns the trophy for the user trophy. 
	 * 
	 * @return Trophy
	 */
	public function getTrophy() {
		return TrophyCache::getInstance()->getTrophyByID($this->trophyID);
	}
	
	/**
	 * Returns the user profile for the user trophy.
	 *
{'fraction_non_alphanumeric': 0.1101010101010101, 'fraction_numerical': 0.007407407407407408, 'mean_word_length': 3.976549413735343, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3834633', 'n_tokens_mistral': 1085, 'n_tokens_neox': 960, 'n_words': 258}