Get the categories options for select input.

@return \Illuminate\Support\Collection
760963
public static function getSelectData()
    {
        $minutes = config('arcanesoft.blog.cache.tags.select-data', 5);

        /** @var  \Illuminate\Database\Eloquent\Collection  $categories */
        return cache()->remember(self::SELECT_CACHE_NAME, $minutes, function () {
            $withTranslations = Blog::instance()->isTranslatable();

            return self::all()->mapWithKeys(function (Tag $tag) use ($withTranslations) {
                return [
                    $tag->id => $withTranslations
                        ? implode(' / ', $tag->getTranslations('name'))
                        : $tag->name
                ];
            });
        })->toBase();
    }
993418
public function get_categories_with_fields() : array {
        if ($this->categories === null) {
            $this->categories = api::get_categories_with_fields($this->get_component(), $this->get_area(), $this->get_itemid());
        }
        $handler = $this;
        array_walk($this->categories, function(category_controller $c) use ($handler) {
            $c->set_handler($handler);
        });
        return $this->categories;
    }
849790
public function getSelectedOptions()
	{
		$ret = array();

		foreach ( $this->getOptions() as $option ) {
			if ( $option->isSelected() ) {
				$ret[] = $option;
			}
		}

		return $ret;
	}
1027952
static public function getChoices()
    {
        $choices = [];

        foreach (static::getCodes() as $code) {
            $choices[static::getLabel($code)] = $code;
        }

        return $choices;
    }
1254430
public function getCategories()
    {
        $apiCategories = [];
        $fileVersion = $this->getFileVersion();
        $categories = $fileVersion->getCategories();

        return array_map(function(CategoryEntity $category) {
            return $category->getId();
        }, $categories->toArray());
    }
1190597
public function getSelections()
    {
        if ($this->_aList === null && $this->oxselectlist__oxvaldesc->value) {
            $this->_aList = false;
            $aList = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($this->oxselectlist__oxvaldesc->getRawValue(), $this->getVat());
            foreach ($aList as $sKey => $oField) {
                if ($oField->name) {
                    $this->_aList[$sKey] = oxNew(\OxidEsales\Eshop\Application\Model\Selection::class, getStr()->strip_tags($oField->name), $sKey, false, $this->_aList === false ? true : false);
                }
            }
        }

        return $this->_aList;
    }
604317
protected function getOptions()
	{
		$options = array();

		/** @var \SimpleXMLElement $option */
		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			$text = $this->translateOptions
				? $this->getText()->alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname))
				: trim((string) $option);

			// Set up option elements.
			$tmp = new stdClass;
			$tmp->value = (string) $option['value'];
			$tmp->text = $text;
			$tmp->disable = ((string) $option['disabled'] == 'true');
			$tmp->class = (string) $option['class'];
			$tmp->onclick = (string) $option['onclick'];

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

		reset($options);

		return $options;
	}
1303243
protected function getOptions(): array
	{
		$options = [];

		foreach($this->options as $group)
		{
			foreach($group as $name => $option)
			{
				$options[] = ['--' . $name, $option['description']];
			}
		}

		sort($options);

		return $options;
	}
911465
protected function options()
    {
        $types  = FieldType::all(['id', 'name', 'type']);
        $return = [];
        foreach ($types as $type) {
            $return[$type->id] = ucfirst(Str::humanize(is_null($type->type) ? $type->name : $type->name . ' ' . $type->type));
        }
        return $return;
    }
1005277
private function getFieldTypeChoices()
    {
        $choices = [];
        foreach ($this->fieldTypeCollectionFactory->getConcreteFieldTypesIdentifiers() as $fieldTypeIdentifier) {
            $choices[$this->getFieldTypeLabel($fieldTypeIdentifier)] = $fieldTypeIdentifier;
        }

        ksort($choices, SORT_NATURAL);

        return $choices;
    }
306883
public function options()
    {
        if (!isset($this->_data['options']) || (isset($this->_data['options']) && empty($this->_data['options']))) {
            // No options provided
            return [];
        }
        if (!is_array($this->_data['options'])) {
            // An empty array?
            return [];
        }

        return ([ResourceTable::ALL_SELECT_VALUES_KEY => trans('resource-table::default.All')] + $this->_data['options']);
    }
1256942
public function getChoices()
    {
        $choices = $this->getOrderedRoles();

        if (isset($choices['ROLE_SUPER_ADMIN'])) {
            unset($choices['ROLE_SUPER_ADMIN']);
        }

        if (isset($choices['ROLE_ADMIN']) && !$this->isCurrentUserSuperAdmin()) {
            unset($choices['ROLE_ADMIN']);
        }

        return $choices;
    }
848222
protected function getOptions()
	{
		// Initialize variables.
		$options = array();

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

			$label = (isset($option[0]) ? $option[0] : $option['label']);

			// Create a new option object based on the <option /> element.
			$tmp = Dropdown::option(
				(string) $option['value'], trim((string) $label), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);
			foreach ($option->attributes() as $index => $value)
			{
				$dataCheck = strtolower(substr($index, 0, 4));
				if ($dataCheck == 'data')
				{
					$tmp->$index = (string) $value;
				}
			}

			// 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;
		}

		reset($options);

		return $options;
	}
1016325
public function getCategoryOptions() {
    static $options = [];
    $program = $this->state['program'];

    if (!$options) {
      $options = ['all' => $this->t('All')];
      $query = $this->entityQuery
        ->get('node')
        ->condition('status', 1)
        ->condition('type', 'program_subcategory')
        ->sort('title');
      if ($program && $program !== 'all') {
        $query->condition('field_category_program', $program);
      }
      $entity_ids = $query->execute();

      $nodes = $this->entityTypeManager->getStorage('node')->loadMultiple($entity_ids);
      foreach ($entity_ids as $id) {
        $options[$id] = $nodes[$id]->getTitle();
      }
    }

    return $options;
  }
1231709
public function options()
    {
        if( request()->has('language') ) {
            return HCMenuGroups::select("id", "name")
                ->where('language_code', request()->input('language'))
                ->orderBy('sequence')
                ->take(50)
                ->get();
        }

        return [];
    }
181704
protected function getCategories()
    {
        return array(
            array(
                'id' => 'environment',
                'label' => __('Environment'),
                'categories' => array(
                    array(
                        'id' => 'comfort',
                        'label' => __('Comfort')
                    ),
                    array(
                        'id' => 'disturbance',
                        'label' => __('Disturbance')
                    ),
                    array(
                        'id' => 'noise',
                        'label' => __('Noise')
                    ),
                    array(
                        'id' => 'powerOutage',
                        'label' => __('Power Outage')
                    ),
                    array(
                        'id' => 'weather',
                        'label' => __('Weather')
                    ),
                )
            ),
            array(
                'id' => 'examinee',
                'label' => __('Examinee'),
                'categories' => array(
                    array(
                        'id' => 'behaviour',
                        'label' => __('Behaviour')
                    ),
                    array(
                        'id' => 'complaint',
                        'label' => __('Complaint')
                    ),
                    array(
                        'id' => 'idAuthorization',
                        'label' => __('ID/Authorization')
                    ),
                    array(
                        'id' => 'illness',
                        'label' => __('Illness')
                    ),
                    array(
                        'id' => 'late',
                        'label' => __('Late')
                    ),
                    array(
                        'id' => 'navigation',
                        'label' => __('Navigation')
                    ),
                    array(
                        'id' => 'noShow',
                        'label' => __('No Show')
                    ),
                )
            ),
            array(
                'id' => 'proctorStaff',
                'label' => __('Proctor/Staff'),
                'categories' => array(
                    array(
                        'id' => 'behaviour',
                        'label' => __('Behaviour')
                    ),
                    array(
                        'id' => 'compliance',
                        'label' => __('Compliance')
                    ),
                    array(
                        'id' => 'error',
                        'label' => __('Error')
                    ),
                    array(
                        'id' => 'late',
                        'label' => __('Late')
                    ),
                    array(
                        'id' => 'noShow',
                        'label' => __('No Show')
                    ),
                )
            ),
            array(
                'id' => 'technical',
                'label' => __('Technical'),
                'categories' => array(
                    array(
                        'id' => 'freezing',
                        'label' => __('Freezing')
                    ),
                    array(
                        'id' => 'launching',
                        'label' => __('Launching')
                    ),
                    array(
                        'id' => 'network',
                        'label' => __('Network')
                    ),
                    array(
                        'id' => 'printing',
                        'label' => __('Printing')
                    ),
                    array(
                        'id' => 'testingWorkstation',
                        'label' => __('Testing Workstation')
                    ),
                )
            ),
            array(
                'id' => 'other',
                'label' => __('Other')
            )
        );
    }
78492
public static function categoryList()
    {
        $data = self::find()->orderBy('category')->groupBy(['category'])->select(['category'])->column();
        return array_combine($data, $data);
    }