<commit_before><?php
namespace application\nutsNBolts\plugin\workflow
{
	use nutshell\behaviour\Singleton;
	use nutshell\core\plugin\Plugin;

	class Workflow extends Plugin implements Singleton
	{
		public function init()
		{

		}

		public function getWorkflowOptions($workflowId=0)
		{
			$records=$this->plugin->Mvc->model->Workflow->read(array('status'=>1));
			$html	=array('<option value="0">No Workflow</option>');
			for ($i=0,$j=count($records); $i<$j; $i++)
			{
				$selected	=($records[$i]['id']==$workflowId)?'selected':'';
				$html[]		='<option value="'.$records[$i]['id'].'" '.$selected.'>'.$records[$i]['name'].'</option>';
			}
			return implode('',$html);
		}
	}
}<commit_msg>Workflow establishing correct db connection.<commit_after><?php
namespace application\nutsNBolts\plugin\workflow
{
	use nutshell\behaviour\Singleton;
	use nutshell\core\plugin\Plugin;

	class Workflow extends Plugin implements Singleton
	{
		private $db=null;

		public function init()
		{
			if ($connection=Nutshell::getInstance()->config->plugin->Mvc->connection)
			{
				$this->db=$this->plugin->Db->{$connection};
			}
		}

		public function getWorkflowOptions($workflowId=0)
		{
			$records=$this->plugin->Mvc->model->Workflow->read(array('status'=>1));
			$html	=array('<option value="0">No Workflow</option>');
			for ($i=0,$j=count($records); $i<$j; $i++)
			{
				$selected	=($records[$i]['id']==$workflowId)?'selected':'';
				$html[]		='<option value="'.$records[$i]['id'].'" '.$selected.'>'.$records[$i]['name'].'</option>';
			}
			return implode('',$html);
		}
	}
}
{'fraction_non_alphanumeric': 0.22525380710659898, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 5.019083969465649, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, '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': '1656591', 'n_tokens_mistral': 612, 'n_tokens_neox': 543, 'n_words': 81}