<commit_before><?php

	/**
	 * Issue <-> custom fields relations table
	 *
	 * @author <NAME> <<EMAIL>>
	 * @version 2.0
	 * @license http://www.opensource.org/licenses/mozilla1.1.php Mozilla Public License 1.1 (MPL 1.1)
	 * @package thebuggenie
	 * @subpackage tables
	 */

	/**
	 * Issue <-> custom fields relations table
	 *
	 * @package thebuggenie
	 * @subpackage tables
	 */
	class TBGIssueCustomFieldsTable extends B2DBTable
	{

		const B2DBNAME = 'issuecustomfields';
		const ID = 'issuecustomfields.id';
		const SCOPE = 'issuecustomfields.scope';
		const ISSUE_ID = 'issuecustomfields.issue_id';
		const OPTION_VALUE = 'issuecustomfields.option_value';
		const CUSTOMFIELDS_ID = 'issuecustomfields.customfields_id';

		public function __construct()
		{
			parent::__construct(self::B2DBNAME, self::ID);
			parent::_addForeignKeyColumn(self::ISSUE_ID, B2DB::getTable('TBGIssuesTable'), TBGIssuesTable::ID);
			parent::_addForeignKeyColumn(self::CUSTOMFIELDS_ID, B2DB::getTable('TBGCustomFieldsTable'), TBGCustomFieldsTable::ID);
			parent::_addForeignKeyColumn(self::OPTION_VALUE, B2DB::getTable('TBGCustomFieldOptionsTable'), TBGCustomFieldOptionsTable::ID);
			parent::_addForeignKeyColumn(self::SCOPE, TBGScopesTable::getTable(), TBGScopesTable::ID);
		}

		public function getAllValuesByIssueID($issue_id)
		{
			$crit = $this->getCriteria();
			$crit->addWhere(self::ISSUE_ID, $issue_id);
			$crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());

			$res = $this->doSelect($crit);<commit_msg>Whoops, forgot to commit a db change that allows non-option based values to be saved<commit_after><?php

	/**
	 * Issue <-> custom fields relations table
	 *
	 * @author <NAME> <<EMAIL>>
	 * @version 2.0
	 * @license http://www.opensource.org/licenses/mozilla1.1.php Mozilla Public License 1.1 (MPL 1.1)
	 * @package thebuggenie
	 * @subpackage tables
	 */

	/**
	 * Issue <-> custom fields relations table
	 *
	 * @package thebuggenie
	 * @subpackage tables
	 */
	class TBGIssueCustomFieldsTable extends B2DBTable
	{

		const B2DBNAME = 'issuecustomfields';
		const ID = 'issuecustomfields.id';
		const SCOPE = 'issuecustomfields.scope';
		const ISSUE_ID = 'issuecustomfields.issue_id';
		const OPTION_VALUE = 'issuecustomfields.option_value';
		const CUSTOMFIELDS_ID = 'issuecustomfields.customfields_id';

		public function __construct()
		{
			parent::__construct(self::B2DBNAME, self::ID);
			parent::_addForeignKeyColumn(self::ISSUE_ID, B2DB::getTable('TBGIssuesTable'), TBGIssuesTable::ID);
			parent::_addForeignKeyColumn(self::CUSTOMFIELDS_ID, B2DB::getTable('TBGCustomFieldsTable'), TBGCustomFieldsTable::ID);
			parent::_addText(self::OPTION_VALUE, false);
			parent::_addForeignKeyColumn(self::SCOPE, TBGScopesTable::getTable(), TBGScopesTable::ID);
		}

		public function getAllValuesByIssueID($issue_id)
		{
			$crit = $this->getCriteria();
			$crit->addWhere(self::ISSUE_ID, $issue_id);
			$crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());

			$res = $this->doSelect($crit);
{'fraction_non_alphanumeric': 0.14157824933687002, 'fraction_numerical': 0.008952254641909815, 'mean_word_length': 5.572984749455338, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1558467', 'n_tokens_mistral': 1108, 'n_tokens_neox': 997, 'n_words': 176}