<commit_before><?php
/**
 * Shows event details for an individual event date/time, and allows user to
 * register to the event.
 *
 * @package silverstripe-eventmanagement
 */
class EventTimeDetailsController extends Page_Controller {

	public static $url_handlers = array(
		'' => 'index'
	);

	protected $parent;
	protected $time;

	public function __construct($parent, $time) {
		$this->parent = $parent;
		$this->time   = $time;

		parent::__construct();
	}

	public function index() {
		return $this->getViewer('index')->process($this);
	}

	/**
	 * @return EventUnregisterController
	 */
	public function unregister() {
		return new EventUnregisterController($this, $this->time);
	}

	/**
	 * @return RegisterableDateTime
	 */
	public function DateTime() {
		return $this->time;
	}

	/**
	 * @return string
	 */
	public function Title() {
		return $this->DateTime()->EventTitle();
	}

	/**
	 * @return Form
	 */
	public function UnregisterForm() {
		return $this->unregister()->UnregisterForm();
	}

	/**
	 * @return string
	 */<commit_msg>Added a method to return a registration controller to the event details controller.<commit_after><?php
/**
 * Shows event details for an individual event date/time, and allows user to
 * register to the event.
 *
 * @package silverstripe-eventmanagement
 */
class EventTimeDetailsController extends Page_Controller {

	public static $url_handlers = array(
		'' => 'index'
	);

	public static $allowed_actions = array(
		'register',
		'unregister'
	);

	protected $parent;
	protected $time;

	public function __construct($parent, $time) {
		$this->parent = $parent;
		$this->time   = $time;

		parent::__construct();
	}

	public function index() {
		return $this->getViewer('index')->process($this);
	}

	/**
	 * @return EventRegisterController
	 */
	public function register() {
		return new EventRegisterController($this, $this->time);
	}

	/**
	 * @return EventUnregisterController
	 */
	public function unregister() {
		return new EventUnregisterController($this, $this->time);
	}

	/**
	 * @return RegisterableDateTime
	 */
	public function DateTime() {
		return $this->time;
	}

	/**
	 * @return string
	 */
	public function Title() {
		return $this->DateTime()->EventTitle();
	}

	/**
	 * @return Form
	 */
	public function RegisterForm() {
		$fields = new FieldSet(
			new EventTicketsTableField()
		);

		return new Form($this, 'RegisterForm', $fields, new FieldSet(
			new FormAction('continue', 'Continue')
		));
	}

	/**
	 * @return Form
	 */
	public function UnregisterForm() {
		return $this->unregister()->UnregisterForm();
	}

	/**
	 * @return string
	 */
{'fraction_non_alphanumeric': 0.14717125382262997, 'fraction_numerical': 0.0, 'mean_word_length': 3.8018348623853213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '5036617', 'n_tokens_mistral': 847, 'n_tokens_neox': 774, 'n_words': 203}