<commit_before><?php namespace Nestor\Repositories;

use Nestor\Model\Execution;

class DbExecutionRepository extends DbBaseRepository implements ExecutionRepository {

	public function __construct(Execution $model)
	{
		parent::__construct($model);
	}

	public function findByTestRunId($test_run_id)
	{
		return $this->model->where('test_run_id', $test_run_id)->get()->toArray();
	}

	public function findByTestCaseVersionId($testCaseVersionId)
	{
		return $this->model->where('test_case_version_id', $testCaseVersionId)->get()->toArray();
	}

	public function findByExecutionStatusId($execution_status_id)
	{
		return $this->model->where('execution_status_id', $execution_status_id)->get()->toArray();
	}

	public function getExecutionsForTestCaseVersion($testRunId, $testCaseVersionId)
	{
		return $this
			->model
			->where('test_case_version_id', '=', $testCaseVersionId)
			->where('test_run_id', '=', $testRunId)
			->orderBy('executions.created_at')
			->with('executionStatus')
			->get()
			->toArray();
	}

}<commit_msg>Fix ordering for test executions<commit_after><?php namespace Nestor\Repositories;

use Nestor\Model\Execution;

class DbExecutionRepository extends DbBaseRepository implements ExecutionRepository {

	public function __construct(Execution $model)
	{
		parent::__construct($model);
	}

	public function findByTestRunId($test_run_id)
	{
		return $this->model->where('test_run_id', $test_run_id)->get()->toArray();
	}

	public function findByTestCaseVersionId($testCaseVersionId)
	{
		return $this->model->where('test_case_version_id', $testCaseVersionId)->get()->toArray();
	}

	public function findByExecutionStatusId($execution_status_id)
	{
		return $this->model->where('execution_status_id', $execution_status_id)->get()->toArray();
	}

	public function getExecutionsForTestCaseVersion($testRunId, $testCaseVersionId)
	{
		return $this
			->model
			->where('test_case_version_id', '=', $testCaseVersionId)
			->where('test_run_id', '=', $testRunId)
			->orderBy('executions.created_at', 'DESC')
			->with('executionStatus')
			->get()
			->toArray();
	}

}
{'fraction_non_alphanumeric': 0.14873266379722622, 'fraction_numerical': 0.0, 'mean_word_length': 6.366197183098592, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '6982480', 'n_tokens_mistral': 733, 'n_tokens_neox': 669, 'n_words': 103}