public function add($passhash = null, $invalidated = null)
	{
		$db = \App::get('db');

		if (empty($db))
		{
			return false;
		}

		if (empty($passhash))
		{
			$passhash = null;
		}

		if (empty($invalidated))
		{
			$invalidated = "UTC_TIMESTAMP()";
		}
		else
		{
			$invalidated = $db->quote($invalidated);
		}

		$user_id = $this->user_id;

		$query = "INSERT INTO `#__users_password_history` (user_id," .
			"passhash,invalidated)" .
			" VALUES ( " .
			$db->quote($user_id) . "," .
			$db->quote($passhash) . "," .
			$invalidated .
			");";

		$db->setQuery($query);

		$result = $db->query();

		if ($result !== false || $db->getErrorNum() == 1062)
		{
			return true;
		}

		return false;
	}