Helper method to get "Where are you from" field options.

@return array List of options.
425800
public function getWhereAreYouFromOptions() {
    $options = [];
    $tree = $this->taxonomyStorage->loadTree(CAMPAIGN_WHERE_ARE_YOU_FROM_VID, 0, 1);
    foreach ($tree as $term) {
      $options[$term->tid] = $term->name;
    }
    return $options;
  }
1193763
public function getStatusOptions()
    {
        $options = array();
        foreach ($this->statuses as $id => $status) {
            if (isset($status['label'])) {
                $options[$id] = $status['label'];
            }
        }
        return $options;
    }
991034
protected function getFields()
    {
        return [
          'title' => new Field('Project title', [
            'optionName' => 'title',
            'description' => 'The initial project title',
            'questionLine' => '',
            'default' => 'Untitled Project',
          ]),
          'region' => new OptionsField('Region', [
            'optionName' => 'region',
            'description' => 'The region where the project will be hosted',
            'options' => $this->getAvailableRegions(),
            'optionsCallback' => function () {
                return $this->getAvailableRegions(true);
            },
          ]),
          'plan' => new OptionsField('Plan', [
            'optionName' => 'plan',
            'description' => 'The subscription plan',
            'options' => $this->getAvailablePlans(),
            'default' => in_array('development', $this->getAvailablePlans()) ? 'development' : null,
            'allowOther' => true,
          ]),
          'environments' => new Field('Environments', [
            'optionName' => 'environments',
            'description' => 'The number of environments',
            'default' => 3,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 50;
            },
          ]),
          'storage' => new Field('Storage', [
            'description' => 'The amount of storage per environment, in GiB',
            'default' => 5,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 1024;
            },
          ]),
        ];
    }
1058576
protected function getOptions()
	{
		return [
			'key' => $this->getKey(),
			'version' => $this->version,
			'region' => $this->getRegion(),
			'language' => $this->getLanguage(),
			'async' => $this->getAsync(),
			'marker' => $this->getMarker(),
			'center' => $this->getCenter(),
			'locate' => $this->getLocate(),
			'zoom' => $this->getZoom(),
			'scrollWheelZoom' => $this->getScrollWheelZoom(),
			'fullscreenControl' => $this->getFullscreenControl(),
			'zoomControl' => $this->getZoomControl(),
			'scaleControl' => $this->getScaleControl(),
			'streetViewControl' => $this->getStreetViewControl(),
			'rotateControl' => $this->getRotateControl(),
			'mapTypeControl' => $this->getMapTypeControl(),
			'type' => $this->getType(),
			'heading' => $this->getHeading(),
			'tilt' => $this->getTilt(),
			'ui' => $this->getUi(),
			'overlay' => '',
			'markers' => [
				'title' => '',
				'label' => '',
				'content' => '',
				'icon' => $this->getIcon(),
				'place' => '',
				'animation' => $this->getAnimation(),
				'symbol' => '',
			],
			'cluster' => $this->getCluster(),
			'clusters' => [
				'icon' => $this->getClustersIcon(),
				'grid' => $this->getClustersGrid(),
				'zoom' => $this->getClustersZoom(),
				'center' => $this->getClustersCenter(),
				'size' => $this->getClustersSize()
			],
		];
	}
1328774
private function getOptions()
    {
        $options = [];
        foreach($this->optionsMap as $property => $name) {
            $options[$name] = $this->options[$property];
        }
        return $options;
    }
809550
protected function getOptions()
    {
        $options = parent::getOptions();

        foreach ($options as $key => $option) {
            if ($option[0] == 'sort') {
                unset($options[$key]);
            }
        }

        return array_merge(
            $options,
            [
                ['sort', null, InputOption::VALUE_OPTIONAL, 'The column (domain, method, uri, name, action) to sort by'],
                ['versions', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Filter the routes by version'],
                ['scopes', 'S', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Filter the routes by scopes'],
                ['protected', null, InputOption::VALUE_NONE, 'Filter the protected routes'],
                ['unprotected', null, InputOption::VALUE_NONE, 'Filter the unprotected routes'],
                ['short', null, InputOption::VALUE_NONE, 'Get an abridged version of the routes'],
            ]
        );
    }
1133946
public function getOptionDefaults()
    {
        $values = array();
        foreach ($this->options as $option) {
            $values[$option->getName()] = $option->getDefault();
        }

        return $values;
    }
1005277
private function getFieldTypeChoices()
    {
        $choices = [];
        foreach ($this->fieldTypeCollectionFactory->getConcreteFieldTypesIdentifiers() as $fieldTypeIdentifier) {
            $choices[$this->getFieldTypeLabel($fieldTypeIdentifier)] = $fieldTypeIdentifier;
        }

        ksort($choices, SORT_NATURAL);

        return $choices;
    }
482127
private function getSortFieldChoices(): array
    {
        $choices = [];
        foreach ($this->getSortField() as $label => $value) {
            $choices[$label] = $value;
        }

        return $choices;
    }
1012449
private function getSortFieldChoices()
    {
        $choices = [];
        foreach ($this->getSortFieldValues() as $sortField) {
            $choices[$this->getSortFieldLabel($sortField)] = $sortField;
        }

        return $choices;
    }
138080
public function fetch()
    {
        $parsedName = $this->getParsedMigrationName();
        $parsedFields = $this->getParsedMigrationFields();

        return [
            'class' => $this->getClass(),
            'up'    => $this->getMigrationUp($parsedName, $parsedFields),
            'down'  => $this->getMigrationDown($parsedName, $parsedFields)
        ];
    }
687048
public function getLocations() {
    $data = [];

    $location_ids = $this->queryFactory->get('node')
      ->condition('type', 'branch')
      ->execute();

    if (!$location_ids) {
      return [];
    }

    $storage = $this->entityTypeManager->getStorage('node');
    $locations = $storage->loadMultiple($location_ids);

    foreach ($locations as $location) {
      $data[$location->id()] = [
        'title' => $location->label(),
      ];
    }

    return $data;
  }
526352
public function getLocationsAsArray()
    {
        // iterate over the location nodes and sort them into an array
        $locations = array();
        /** @var \AppserverIo\Appserver\Core\Api\Node\LocationNode $locationNode */
        foreach ($this->getLocations() as $locationNode) {
            // restructure to an array
            $locations[$locationNode->getCondition()] = array(
                'condition' => $locationNode->getCondition(),
                'params'    => $locationNode->getParamsAsArray(),
                'handlers' =>  $locationNode->getFileHandlersAsArray(),
                'headers' =>  $locationNode->getHeadersAsArray()
            );
        }

        // return what we got
        return $locations;
    }
1334902
public function getCMSFields()
    {
        // Obtain Field Objects (from parent):
        
        $fields = parent::getCMSFields();
        
        // Create Field Objects:
        
        $fields->fieldByName('Root.Options.TitleOptions')->push(
            CheckboxField::create(
                'UseLevelTitle',
                $this->fieldLabel('UseLevelTitle')
            )
        );
        
        // Create Options Fields:
        
        $fields->addFieldToTab(
            'Root.Options',
            FieldSection::create(
                'NavigationOptions',
                $this->fieldLabel('NavigationOptions'),
                [
                    DropdownField::create(
                        'SortBy',
                        $this->fieldLabel('SortBy'),
                        $this->getSortByOptions()
                    ),
                    CheckboxField::create(
                        'ShowCount',
                        $this->fieldLabel('ShowCount')
                    )
                ]
            )
        );
        
        // Answer Field Objects:
        
        return $fields;
    }
1038633
public static function getOptions()
    {
        $options = [];

        $options[] = [
            'id' => Operation::PRODUCT_VISA,
            'label' => "Visa",
        ];
        $options[] = [
            'id' => Operation::PRODUCT_MASTERCARD,
            'label' => "Mastercard",
        ];
        $options[] = [
            'id' => Operation::PRODUCT_AMERICAN_EXPRESS,
            'label' => "American Express",
        ];
        $options[] = [
            'id' => Operation::PRODUCT_DINERS,
            'label' => "Diners",
        ];


        return $options;
    }
993619
public function getRelatedCountries()
    {
        $conn = $this->app->getApplicationBox()->get_connection();

        $sql = 'SELECT DISTINCT Users.country ' . $this->generate_sql_constraints() . ' ORDER BY Users.country';

        $stmt = $conn->prepare($sql);
        $stmt->execute($this->sql_params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        $countries = [];
        $listCountry = Countries::getCountries($this->app['locale']);
        foreach ($rs as $row) {
            if (trim($row['country']) === '') {
                continue;
            }

            if (isset($listCountry[$row['country']])) {
                $countries[$row['country']] = $listCountry[$row['country']];
            }
        }

        return $countries;
    }
627876
public static function getChoices() {
        return [
            self::MARITAL_STATUS_EMPTY    => "choices.marital-status.empty",
            self::MARITAL_STATUS_SINGLE   => "choices.marital-status.single",
            self::MARITAL_STATUS_PACS     => "choices.marital-status.pacs",
            self::MARITAL_STATUS_MARRIED  => "choices.marital-status.married",
            self::MARITAL_STATUS_WIDOWER  => "choices.marital-status.widower",
            self::MARITAL_STATUS_DIVORCED => "choices.marital-status.divorced",
        ];
    }