Get a list of editable tickets
These have an numeric input field

@return ArrayList
960666
private function getEditableTickets()
    {
        $tickets = ArrayList::create();
        foreach ($this->getTickets() as $ticket) {
            /** @var Ticket $ticket */
            $fieldName = $this->name . "[{$ticket->ID}][Amount]";
            $range = range($ticket->OrderMin, $ticket->OrderMax);

            $ticket->AmountField = DropdownField::create($fieldName, 'Amount', array_combine($range, $range))
                ->setHasEmptyDefault(true)
                ->setEmptyString(_t('TicketsField.EMPTY', 'Tickets'));

            // Set the first to hold the minimum
            if ($this->getTickets()->count() === 1) {
                $ticket->AmountField->setValue($ticket->OrderMin);
            }

            $availability = $ticket->Event()->getAvailability();
            if ($availability < $ticket->OrderMax) {
                $disabled = range($availability + 1, $ticket->OrderMax);
                $ticket->AmountField->setDisabledItems(array_combine($disabled, $disabled));
            }

            if (!$ticket->getAvailable()) {
                $ticket->AmountField->setDisabled(true);
            }

            $tickets->push($ticket);
        }
        return $tickets;
    }
923185
protected function getParamsArray()
    {
        return array(
            'tabbed' => $this->tabbed,
            'includeRelations' => $this->includeRelations,
            'restrictFields' => $this->restrictFields,
            'fieldClasses' => $this->fieldClasses,
            'ajaxSafe' => $this->ajaxSafe
        );
    }
307175
public function toOptionArray()
    {
        $fields = $this->dataHelper->getOrderTableDescription();

        $customFields[] = [
            'label' => __('---- Default Option ----'),
            'value' => '0',
        ];
        foreach ($fields as $field) {
            $customFields[] = [
                'value' => $field['COLUMN_NAME'],
                'label' => $field['COLUMN_NAME'],
            ];
        }

        return $customFields;
    }
913810
public function ItemEditForm() {
        $list=$this->gridField->getList();
        
        if(empty($this->record)) {
            $controller=$this->getToplevelController();
            $noActionURL=$controller->removeAction($_REQUEST['url']);
            
            $controller->getResponse()->removeHeader('Location');   //clear the existing redirect
            
            return $controller->redirect($noActionURL, 302);
        }

        $canView=$this->record->canView();
        $canEdit=$this->record->canEdit();
        $canDelete=$this->record->canDelete();
        $canCreate=$this->record->canCreate();

        if(!$canView) {
            return $this->getToplevelController()->httpError(403);
        }
        
        $actions=new FieldList();
        if($this->record->ID!==0) {
            if($canEdit) {
                $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Save', 'Save'))
                                                ->setUseButtonTag(true)
                                                ->addExtraClass('ss-ui-action-constructive')
                                                ->setAttribute('data-icon', 'accept'));
            }
            
            if($canDelete) {
                $actions->push(FormAction::create('doDelete', _t('GridFieldDetailForm.Delete', 'Delete'))
                                                ->setUseButtonTag(true)
                                                ->addExtraClass('ss-ui-action-destructive action-delete'));
            }
        }else { // adding new record
            //Change the Save label to 'Create'
            $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Create', 'Create'))
                                            ->setUseButtonTag(true)
                                            ->addExtraClass('ss-ui-action-constructive')
                                            ->setAttribute('data-icon', 'add'));
            
            // Add a Cancel link which is a button-like link and link back to one level up.
            $curmbs = $this->Breadcrumbs();
            if($curmbs && $curmbs->count()>=2){
                $one_level_up = $curmbs->offsetGet($curmbs->count()-2);
                $text=sprintf(
                    "<a class=\"%s\" href=\"%s\">%s</a>",
                    "crumb ss-ui-button ss-ui-action-destructive cms-panel-link ui-corner-all", // CSS classes
                    $one_level_up->Link, // url
                    _t('GridFieldDetailForm.CancelBtn', 'Cancel') // label
                );
                
                $actions->push(new LiteralField('cancelbutton', $text));
            }
        }
        
        // If we are creating a new record in a has-many list, then
        // pre-populate the record's foreign key.
        if($list instanceof HasManyList && !$this->record->isInDB()) {
            $key=$list->getForeignKey();
            $id=$list->getForeignID();
            $this->record->$key=$id;
        }
        
        $fields=$this->component->getFields();
        if(!$fields) {
            $fields=($this->record->hasMethod('getFrontEndFields') ? $this->record->getFrontEndFields():$this->record->getCMSFields());
        }
        
        // If we are creating a new record in a has-many list, then
        // Disable the form field as it has no effect.
        if($list instanceof HasManyList) {
            $key=$list->getForeignKey();
            
            if($field=$fields->dataFieldByName($key)) {
                $fields->makeFieldReadonly($field);
            }
        }
        
        // this pushes the current page ID in as a hidden field
        // this means the request will have the current page ID in it
        // rather than relying on session which can have been rewritten
        // by the user having another tab open
        // see LeftAndMain::currentPageID
        if($this->controller->hasMethod('currentPageID') && $this->controller->currentPageID()) {
            $fields->push(new HiddenField('CMSMainCurrentPageID', null, $this->controller->currentPageID()));
        }
        
        // Caution: API violation. Form expects a Controller, but we are giving it a RequestHandler instead.
        // Thanks to this however, we are able to nest GridFields, and also access the initial Controller by
        // dereferencing GridFieldDetailForm_ItemRequest->getController() multiple times. See getToplevelController
        // below.
        $form=new Form(
            $this,
            'ItemEditForm',
            $fields,
            $actions,
            $this->component->getValidator()
        );
        
        $form->loadDataFrom($this->record, ($this->record->ID==0 ? Form::MERGE_IGNORE_FALSEISH:Form::MERGE_DEFAULT));
        
        if($this->record->ID && !$canEdit) {
            // Restrict editing of existing records
            $form->makeReadonly();
            
            // Hack to re-enable delete button if user can delete
            if($canDelete) {
                $form->Actions()->fieldByName('action_doDelete')->setReadonly(false);
            }
        }else if(!$this->record->ID && !$canCreate) {
            // Restrict creation of new records
            $form->makeReadonly();
        }
        
        // Load many_many extraData for record.
        // Fields with the correct 'ManyMany' namespace need to be added manually through getCMSFields().
        if($list instanceof ManyManyList) {
            $extraData=$list->getExtraData('', $this->record->ID);
            $form->loadDataFrom(array('ManyMany' => $extraData));
        }
        
        $cb=$this->component->getItemEditFormCallback();
        if($cb) {
            $cb($form, $this);
        }
        
        $this->extend("updateItemEditForm", $form);
        return $form;
    }
1149661
public static function getPossibleValues(): array
    {
        return [
            self::POST,
            self::PUT,
            self::PATCH,
            self::DELETE,
            self::GET,
        ];
    }
71399
public function getSupportedParams()
    {
        return [
            self::PARAM_INCLUSIONS  => true,
            self::PARAM_FIELDSETS   => true,
            self::PARAM_SORTING     => true,
            self::PARAM_PAGINATION  => true,
            self::PARAM_FILTERING   => true,
        ];
    }
840421
public function toArray()
    {
        $result = parent::toArray();

        $result['eventKey'] = $this->eventKey;
        $result['ticket']   = $this->ticket;

        return $result;
    }
364252
private function getEditableAttendees()
    {
        $attendees = ArrayList::create();
        /** @var Attendee $attendee */
        foreach ($this->getReservation()->Attendees() as $key => $attendee) {
            $fieldName = $this->name . "[{$attendee->ID}][TicketReceiver]";
            $attendee->TicketReceiverField = CheckboxField::create($fieldName)
                ->setAttribute('Title', _t('SummaryField.TICKET_RECEIVER_HELP', 'Send tickets to this person'))
                ->setDisabled(empty($attendee->Email));
            // Select the first by default
            if ($this->getReservation()->MainContact()->ID === $attendee->ID) {
                $attendee->TicketReceiverField->setValue(1);
            }
            $attendees->push($attendee);
        }
        return $attendees;
    }
1121132
public function getEnabledSlides()
    {
        $slides = ArrayList::create();
        
        foreach ($this->getListItems() as $item) {
            
            if ($slide = $this->createSlide($item)) {
                $slides->push($slide);
            }
            
        }
        
        return $slides;
    }
491699
protected function getInput()
	{
		// Initialize variables.
		$options = array();
		$attr = '';

		// Initialize some field attributes.
		$attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$attr .= ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
		$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
		$attr .= $this->multiple ? ' multiple="multiple"' : '';

		// Initialize JavaScript field attributes.
		$attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		// Iterate through the children and build an array of options.
		foreach ($this->element->children() as $option)
		{

			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			// Create a new option object based on the <option /> element.
			$tmp = Dropdown::option((string) $option['value'], trim((string) $option), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		return Access::usergroup($this->name, $this->value, $attr, $options, $this->id);
	}
613281
public function getInput()
    {
        //fix for https://github.com/atk4/ui/issues/618
        if (isset($this->field)) {
            $value = $this->app->ui_persistence->typecastSaveField($this->field, $this->field->get());
        } else {
            $value = $this->content ?: '';
        }

        return $this->app->getTag('input', [
            'name'        => $this->short_name,
            'type'        => $this->inputType,
            'id'          => $this->id.'_input',
            'value'       => $value,
            'readonly'    => $this->readonly ? 'readonly' : false,
            'disabled'    => $this->disabled ? 'disabled' : false,
        ]);
    }
347357
protected function getInput()
	{
		// Initialize some field attributes.
		$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
		$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';

		// Initialize JavaScript field attributes.
		$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';

		return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
			. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $onchange . ' />';
	}
23888
protected function fieldfillers() {

		$fieldrender = $this->fieldrender();

		if ($this->hintrenderer !== null) {
			$callable = &$this->hintrenderer;
			$hintsrender = $callable($this->hints());
		}
		else { # no hint renderer
			$hintsrender = null;
		}

		if ($this->showerrors && $this->errorrenderer) {
			$callable = &$this->errorrenderer;
			$errorrrender = $callable($this->errors());
		}
		else { # no error renderer
			$errorrrender = null;
		}

		return array
			(
				':id'     => $this->get('id', null),
				':field'  => $fieldrender,
				':label'  => $this->fieldlabel(),
				':hints'  => $hintsrender,
				':errors' => $errorrrender,
			);
	}
40612
protected function getListEvent()
    {
        $options = array(
            'order' => 'desc',
            'sort' => 'created',
            'limit' => $this->getLimit(),
            'severity' => $this->getParam('severity')
        );

        return (array) $this->report->getList($options);
    }
703278
public function getBetterButtonsActions()
    {
        /** @var FieldList $fields */
        $fields = parent::getBetterButtonsActions();
        $fields->push(BetterButtonCustomAction::create('send', _t('Reservation.RESEND', 'Resend the reservation')));

        return $fields;
    }
173212
public function getActionAllowableValues()
    {
        return [
            self::ACTION_ADD,
            self::ACTION_ASSEMBLE,
            self::ACTION_CONFIGURE,
            self::ACTION_ENTER_PASSWORD,
            self::ACTION_LOCK,
            self::ACTION_MOVE,
            self::ACTION_REPACKAGE,
            self::ACTION_SET_NAME,
            self::ACTION_SET_PASSWORD,
            self::ACTION_UNLOCK,
        ];
    }
28748
private function getDatatableOptions(): array
    {
        list($plugin, $controller) = pluginSplit($this->entity->get('model'));

        $result = [
            'table_id' => '#' . $this->getTableId(),
            'order' => [$this->getOrderField(), $this->getOrderDirection()],
            'ajax' => [
                'url' => Router::url([
                    'plugin' => $plugin,
                    'controller' => $controller,
                    'action' => $this->action,
                    $this->preSaveId
                ]),
                'columns' => $this->getDatatableColumns(),
                'extras' => ['format' => 'pretty']
            ],
        ];

        if (! $this->getGroupByField() && $this->batch) {
            $result['batch'] = ['id' => Configure::read('Search.batch.button_id')];
        }

        return $result;
    }