<commit_before><?php
/**
 * An instance of an event that a person can register to attend.
 */
class RegistrableDateTime extends CalendarDateTime {

	private static $db = array(
		'Capacity'      => 'Int',
		'EmailReminder' => 'Boolean',
		'RemindDays'    => 'Int'
	);

	private static $has_many = array(
		'Registrations' => 'EventRegistration'
	);

	private static $many_many = array(
		'Tickets' => 'EventTicket'
	);

	private static $many_many_extraFields = array(
		'Tickets' => array('Available' => 'Int', 'Sort' => 'Int')
	);

	public function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->removeByName('Capacity');
		$fields->removeByName('Registrations');
		$fields->removeByName('Tickets');
		$fields->removeByName('EmailReminder');
		$fields->removeByName('RemindDays');
		$fields->removeByName('PaymentID');
		$fields->removeByName('ReminderJobID');

		if (!$this->isInDB()) {
			$fields->push(new LiteralField(
				'RegistrationNote', '<p>You can configure registration once ' .
				'you save for the first time.</p>'
			));

			return $fields;
		}


		$fields->push(
			new GridField(
				'Tickets',
				_t('EventManagement.AVAILABLE_TICKETS', 'Available Tickets'),
				$this->Tickets(),
				GridFieldConfig::create()
					->addComponent(new GridFieldButtonRow('before'))
					->addComponent(new GridFieldToolbarHeader())
					->addComponent($add = new GridFieldAddExistingSearchButton())<commit_msg>Set a better singular_name for RegistrableDateTime<commit_after><?php
/**
 * An instance of an event that a person can register to attend.
 */
class RegistrableDateTime extends CalendarDateTime {

	private static $db = array(
		'Capacity'      => 'Int',
		'EmailReminder' => 'Boolean',
		'RemindDays'    => 'Int'
	);

	private static $has_many = array(
		'Registrations' => 'EventRegistration'
	);

	private static $many_many = array(
		'Tickets' => 'EventTicket'
	);

	private static $many_many_extraFields = array(
		'Tickets' => array('Available' => 'Int', 'Sort' => 'Int')
	);

	private static $singular_name = "Date Time";

	public function getCMSFields() {
		$fields = parent::getCMSFields();

		$fields->removeByName('Capacity');
		$fields->removeByName('Registrations');
		$fields->removeByName('Tickets');
		$fields->removeByName('EmailReminder');
		$fields->removeByName('RemindDays');
		$fields->removeByName('PaymentID');
		$fields->removeByName('ReminderJobID');

		if (!$this->isInDB()) {
			$fields->push(new LiteralField(
				'RegistrationNote', '<p>You can configure registration once ' .
				'you save for the first time.</p>'
			));

			return $fields;
		}


		$fields->push(
			new GridField(
				'Tickets',
				_t('EventManagement.AVAILABLE_TICKETS', 'Available Tickets'),
				$this->Tickets(),
				GridFieldConfig::create()
					->addComponent(new GridFieldButtonRow('before'))
					->addComponent(new GridFieldToolbarHeader())
					->addComponent($add = new GridFieldAddExistingSearchButton())
{'fraction_non_alphanumeric': 0.15976933514246947, 'fraction_numerical': 0.0, 'mean_word_length': 4.606463878326996, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 51, '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': '4427373', 'n_tokens_mistral': 1040, 'n_tokens_neox': 920, 'n_words': 197}