<commit_before><?php
/**
 * @author: KentProjects <<EMAIL>>
 * @license: Copyright KentProjects
 * @link: http://kentprojects.com
 */
class Model_Notification extends Model
{
	/**
	 * If you add any new types, please update the docs!
	 *
	 * @var array
	 */
	protected static $typeStrings = array(
		"user_got_a_notification" => array(
			"default" => "You just got a notification. Yippee!"
		),
		"user_wants_to_access_a_year" => array(
			"default" => "ACTOR_NAME would like access to YEAR."
		),
		"user_approved_access_to_year" => array(
			"default" => "USER_NAME was granted access to YEAR.",
			"actor" => "You granted USER_NAME access to YEAR.",
			"user" => "ACTOR_NAME granted you access to YEAR."
		),
		"user_rejected_access_to_year" => array(
			"default" => "USER_NAME was granted access to YEAR.",
			"actor" => "You granted USER_NAME access to YEAR.",
			"user" => "ACTOR_NAME granted you access to YEAR."
		),
		"user_wants_to_join_a_group" => array(
			"default" => "ACTOR_NAME would like to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME would like to join your group."
		),
		"user_approved_another_to_join_a_group" => array(
			"default" => "ACTOR_NAME approved USER_NAME to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME approved USER_NAME to join your group."
		),
		"user_rejected_another_to_join_a_group" => array(
			"default" => "ACTOR_NAME rejected USER_NAME to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME rejected USER_NAME to join your group."
		),
		"user_joined_a_group" => array(
			"default" => "ACTOR_NAME joined GROUP_NAME.",
			"group_member" => "ACTOR_NAME joined your group."
		),
		"user_left_a_group" => array(
			"default" => "ACTOR_NAME left GROUP_NAME.",
			"group_member" => "ACTOR_NAME left your group."
		),
		"group_wants_to_undertake_a_project" => array(
			"default" => "GROUP_NAME would like to do PROJECT_NAME."
		),
		"group_undertaken_project_approved" => array(
			"default" => "GROUP_NAME has been approved to do PROJECT_NAME.",
			"group_member" => "Your group has been approved to do PROJECT_NAME.",
			"supervisor" => "You approved GROUP_NAME to do PROJECT_NAME."
		),
		"group_undertaken_project_rejected" => array(
			"default" => "GROUP_NAME has been rejected to do PROJECT_NAME.",
			"group_member" => "Your group has been rejected to do PROJECT_NAME.",
			"supervisor" => "You rejected GROUP_NAME to do PROJECT_NAME."
		),
		"group_released_project" => array(
			"default" => "GROUP_NAME is no longer doing PROJECT_NAME.",
			"group_member" => "Your group is no longer doing PROJECT_NAME."
		)
	);

	/**
	 * Get the relevant Notification by it's ID.
	 *
	 * @param int $id
	 * @return Model_Notification
	 */
	public static function getById($id)
	{
		if (empty($id))
		{
			return null;
		}
		/** @var Model_Notification $notification */
		$notification = parent::getById($id);
		if (empty($notification))
		{
			$notification = Database::prepare(
				"SELECT
					`notification_id` AS 'id',
					`type`,
					`actor_id` AS 'actor',
					`group_id` AS 'group',
					`project_id` AS 'project',
					`user_id` AS 'user',
					`year`,
					`created`
				 FROM `Notification`
				 WHERE `notification_id` = ?",<commit_msg>Yes, of course `intent` will be `null` when the SQL doesn't get the `intent_id` from the row...!<commit_after><?php
/**
 * @author: KentProjects <<EMAIL>>
 * @license: Copyright KentProjects
 * @link: http://kentprojects.com
 */
class Model_Notification extends Model
{
	/**
	 * If you add any new types, please update the docs!
	 *
	 * @var array
	 */
	protected static $typeStrings = array(
		"user_got_a_notification" => array(
			"default" => "You just got a notification. Yippee!"
		),
		"user_wants_to_access_a_year" => array(
			"default" => "ACTOR_NAME would like access to YEAR."
		),
		"user_approved_access_to_year" => array(
			"default" => "USER_NAME was granted access to YEAR.",
			"actor" => "You granted USER_NAME access to YEAR.",
			"user" => "ACTOR_NAME granted you access to YEAR."
		),
		"user_rejected_access_to_year" => array(
			"default" => "USER_NAME was granted access to YEAR.",
			"actor" => "You granted USER_NAME access to YEAR.",
			"user" => "ACTOR_NAME granted you access to YEAR."
		),
		"user_wants_to_join_a_group" => array(
			"default" => "ACTOR_NAME would like to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME would like to join your group."
		),
		"user_approved_another_to_join_a_group" => array(
			"default" => "ACTOR_NAME approved USER_NAME to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME approved USER_NAME to join your group."
		),
		"user_rejected_another_to_join_a_group" => array(
			"default" => "ACTOR_NAME rejected USER_NAME to join GROUP_NAME.",
			"group_member" => "ACTOR_NAME rejected USER_NAME to join your group."
		),
		"user_joined_a_group" => array(
			"default" => "ACTOR_NAME joined GROUP_NAME.",
			"group_member" => "ACTOR_NAME joined your group."
		),
		"user_left_a_group" => array(
			"default" => "ACTOR_NAME left GROUP_NAME.",
			"group_member" => "ACTOR_NAME left your group."
		),
		"group_wants_to_undertake_a_project" => array(
			"default" => "GROUP_NAME would like to do PROJECT_NAME."
		),
		"group_undertaken_project_approved" => array(
			"default" => "GROUP_NAME has been approved to do PROJECT_NAME.",
			"group_member" => "Your group has been approved to do PROJECT_NAME.",
			"supervisor" => "You approved GROUP_NAME to do PROJECT_NAME."
		),
		"group_undertaken_project_rejected" => array(
			"default" => "GROUP_NAME has been rejected to do PROJECT_NAME.",
			"group_member" => "Your group has been rejected to do PROJECT_NAME.",
			"supervisor" => "You rejected GROUP_NAME to do PROJECT_NAME."
		),
		"group_released_project" => array(
			"default" => "GROUP_NAME is no longer doing PROJECT_NAME.",
			"group_member" => "Your group is no longer doing PROJECT_NAME."
		)
	);

	/**
	 * Get the relevant Notification by it's ID.
	 *
	 * @param int $id
	 * @return Model_Notification
	 */
	public static function getById($id)
	{
		if (empty($id))
		{
			return null;
		}
		/** @var Model_Notification $notification */
		$notification = parent::getById($id);
		if (empty($notification))
		{
			$notification = Database::prepare(
				"SELECT
					`notification_id` AS 'id',
					`type`,
					`actor_id` AS 'actor',
					`group_id` AS 'group',
					`intent_id` AS 'intent',
					`project_id` AS 'project',
					`user_id` AS 'user',
					`year`,
					`created`
				 FROM `Notification`
				 WHERE `notification_id` = ?",
{'fraction_non_alphanumeric': 0.13526792568708737, 'fraction_numerical': 0.0, 'mean_word_length': 3.8903903903903903, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 87, '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': '5967468', 'n_tokens_mistral': 2513, 'n_tokens_neox': 2167, 'n_words': 611}