<commit_before><?php defined('SYSPATH') or die('No direct script access.');

class View_Model_Ticket extends View_Model {

	public function title()
	{
		return $this->_model->get('title');
	}

	public function description()
	{
		return $this->_model->get('description');
	}

	public function author()
	{
		return View_Model::factory($this->_model->get_author());
	}

	public function history()
	{
		$data = array();

		foreach ($this->_model->get('history') as $item)
		{
			$item['date_time'] = date('m/d/Y h:i a', $item['time']);
			$item['author'] = View_Model::factory($this->_model->get_author($item['created_by']));
			$data[] = $item;
		}

		return $data;
	}

	public function created_on_date_time()
	{
		if ( ! $this->_model->get('created_on'))
			return NULL;

		return date('m/d/Y h:i a', $this->_model->get('created_on'));
	}

	public function updated_on_date_time()
	{
		if ( ! $this->_model->get('updated_on'))
			return NULL;

		return date('m/d/Y h:i a', $this->_model->get('updated_on'));
	}

	public function url()
	{
		return Route::url('hyla-tracker', array(
				'slug'   => $this->_model->get_project()->get('slug'),
				'action' => 'view',
				'ticket' => $this->_model->get('_id'),
			));
	}
}<commit_msg>update to the ticket view model to add an update_url<commit_after><?php defined('SYSPATH') or die('No direct script access.');

class View_Model_Ticket extends View_Model {

	protected $_as_array_methods = array(
		'author', 'history',
		'url', 'update_url',
		'created_on_date_time', 'created_on_date_time',
	);

	public function author()
	{
		return View_Model::factory($this->_model->get_author())
			->as_array();
	}

	public function history()
	{
		$data = array();

		foreach ($this->_model->get('history') as $item)
		{
			$item['date_time'] = date('m/d/Y h:i a', $item['time']);
			$item['author'] = View_Model::factory($this->_model->get_author($item['created_by']));
			$data[] = $item;
		}

		return $data;
	}

	public function created_on_date_time()
	{
		if ( ! $this->_model->get('created_on'))
			return NULL;

		return date('m/d/Y h:i a', $this->_model->get('created_on'));
	}

	public function updated_on_date_time()
	{
		if ( ! $this->_model->get('updated_on'))
			return NULL;

		return date('m/d/Y h:i a', $this->_model->get('updated_on'));
	}

	public function url()
	{
		return Route::url('hyla-tracker', array(
				'slug'   => $this->_model->get_project()->get('slug'),
				'action' => 'view',
				'ticket' => $this->_model->get('_id'),
			));
	}

	public function update_url()
	{
		return Route::url('hyla-tracker', array(
			'action' => 'update',
			'slug'   => $this->_model->get_project()->get('slug'),
			'ticket' => $this->_model->get('_id'),
		));
	}
}
{'fraction_non_alphanumeric': 0.21085672082717874, 'fraction_numerical': 0.0, 'mean_word_length': 4.270428015564202, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 60, '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': '7653692', 'n_tokens_mistral': 1071, 'n_tokens_neox': 975, 'n_words': 185}