<commit_before><?
use \Framework\Newnorth\Application;
use \Framework\Newnorth\DataType;
use \Framework\Newnorth\DbUpdateQuery;
use \Framework\Newnorth\DbAnd;
use \Framework\Newnorth\DbEqualTo;

class TestDataType extends DataType {
	/* Variables */

	public $Id;

	public $Title;

	public $TimeLastFailed;

	public $State;

	public $StateDescription;

	public $StatePriorityLevel;

	public $TimeLastExecuted;

	public $ExecutionInterval;

	public $IsExecuting;

	public $Url;

	/* Magic methods */

	public function __construct($Data) {
		if(isset($Data['Id'])) {
			$this->Id = (int)$Data['Id'];
		}

		if(isset($Data['Title'])) {
			$this->Title = $Data['Title'];
		}

		if(isset($Data['TimeLastFailed'])) {
			$this->TimeLastFailed = (int)$Data['TimeLastFailed'];
		}

		if(isset($Data['State'])) {
			$this->State = $Data['State'];
		}

		if(isset($Data['StateDescription'])) {
			$this->StateDescription = $Data['StateDescription'];
		}

		if(isset($Data['StatePriorityLevel'])) {
			$this->StatePriorityLevel = $Data['StatePriorityLevel'];
		}

		if(isset($Data['TimeLastExecuted'])) {
			$this->TimeLastExecuted = (int)$Data['TimeLastExecuted'];
		}

		if(isset($Data['ExecutionInterval'])) {
			$this->ExecutionInterval = (int)$Data['ExecutionInterval'];
		}

		if(isset($Data['IsExecuting'])) {
			$this->IsExecuting = $Data['IsExecuting'] === '1';
		}

		if(isset($Data['URL'])) {
			$this->Url = $Data['URL'];
		}
	}

	/* Methods */

 	public function SetIsExecuting($Value) {
		$Value = (bool)$Value;

		$Query = new DbUpdateQuery();

		$Query->AddSource('Test');

		$Query->AddChange('`IsExecuting`', $Value);

		$Query->Conditions = new DbAnd();

		$Query->Conditions->EqualTo('`Id`', $this->Id);

		$Connection = Application::GetDbConnection('Default');

		$Connection->Update($Query);

		$this->IsExecuting = $Value;
	}
}
?><commit_msg>Added SetTimeLastExecuted-method on TestDataType<commit_after><?
use \Framework\Newnorth\Application;
use \Framework\Newnorth\DataType;
use \Framework\Newnorth\DbUpdateQuery;
use \Framework\Newnorth\DbAnd;
use \Framework\Newnorth\DbEqualTo;

class TestDataType extends DataType {
	/* Variables */

	public $Id;

	public $Title;

	public $TimeLastFailed;

	public $State;

	public $StateDescription;

	public $StatePriorityLevel;

	public $TimeLastExecuted;

	public $ExecutionInterval;

	public $IsExecuting;

	public $Url;

	/* Magic methods */

	public function __construct($Data) {
		if(isset($Data['Id'])) {
			$this->Id = (int)$Data['Id'];
		}

		if(isset($Data['Title'])) {
			$this->Title = $Data['Title'];
		}

		if(isset($Data['TimeLastFailed'])) {
			$this->TimeLastFailed = (int)$Data['TimeLastFailed'];
		}

		if(isset($Data['State'])) {
			$this->State = $Data['State'];
		}

		if(isset($Data['StateDescription'])) {
			$this->StateDescription = $Data['StateDescription'];
		}

		if(isset($Data['StatePriorityLevel'])) {
			$this->StatePriorityLevel = $Data['StatePriorityLevel'];
		}

		if(isset($Data['TimeLastExecuted'])) {
			$this->TimeLastExecuted = (int)$Data['TimeLastExecuted'];
		}

		if(isset($Data['ExecutionInterval'])) {
			$this->ExecutionInterval = (int)$Data['ExecutionInterval'];
		}

		if(isset($Data['IsExecuting'])) {
			$this->IsExecuting = $Data['IsExecuting'] === '1';
		}

		if(isset($Data['URL'])) {
			$this->Url = $Data['URL'];
		}
	}

	/* Methods */

 	public function SetIsExecuting($Value) {
		$Value = (bool)$Value;

		$Query = new DbUpdateQuery();

		$Query->AddSource('Test');

		$Query->AddChange('`IsExecuting`', $Value);

		$Query->Conditions = new DbAnd();

		$Query->Conditions->EqualTo('`Id`', $this->Id);

		$Connection = Application::GetDbConnection('Default');

		$Connection->Update($Query);

		$this->IsExecuting = $Value;
	}

 	public function SetTimeLastExecuted($Value) {
		$Value = (int)$Value;

		$Query = new DbUpdateQuery();

		$Query->AddSource('Test');

		$Query->AddChange('`TimeLastExecuted`', $Value);

		$Query->Conditions = new DbAnd();

		$Query->Conditions->EqualTo('`Id`', $this->Id);

		$Connection = Application::GetDbConnection('Default');

		$Connection->Update($Query);

		$this->TimeLastExecuted = $Value;
	}
}
?>
{'fraction_non_alphanumeric': 0.19821557752592237, 'fraction_numerical': 0.0004822763443453099, 'mean_word_length': 4.85049365303244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '901284', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1376, 'n_words': 212}