Retrieve the options for the attributes.

@param GetOptionsEvent $event The event.

@return void
192318
public function getOptions(GetOptionsEvent $event)
    {
        if (($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_attribute')
            || ($event->getPropertyName() !== 'combinedvalues_fields')
            || ($event->getSubPropertyName() !== 'field_attribute')
        ) {
            return;
        }

        $model     = $event->getModel();
        $metaModel = $this->getMetaModelById($model->getProperty('pid'));

        if (!$metaModel) {
            return;
        }

        $result = [];
        // Add meta fields.
        $result['meta'] = self::getMetaModelsSystemColumns();

        // Fetch all attributes except for the current attribute.
        foreach ($metaModel->getAttributes() as $attribute) {
            if ($attribute->get('id') === $model->getId()) {
                continue;
            }

            $type = $event
                ->getEnvironment()
                ->getTranslator()
                ->translate('typeOptions.'.$attribute->get('type'), 'tl_metamodel_attribute');

            if ($type == 'typeOptions.'.$attribute->get('type')) {
                $type = $attribute->get('type');
            }

            $result['attributes'][$attribute->getColName()] = \sprintf(
                '%s [%s]',
                $attribute->getName(),
                $type
            );
        }

        $event->setOptions($result);
    }
814884
public function getData(GetDataEvent $event)
    {
        $options = $event->getOptions();
        $options['hiddenFilters']['hidden'] = false;

        if (DataSource::CONTEXT_WORKSPACE === $event->getContext()) {
            //parent allow to fetch things outside of the workspace.
            if (!isset($options['filters']) || !array_key_exists('parent', $options['filters'])) {
                // only grab workspace root directory content
                /** @var ResourceNode $workspaceRoot */
                $workspaceRoot = $this->repository->findOneBy([
                'parent' => null,
                'workspace' => $event->getWorkspace(),
            ]);

                $options['hiddenFilters']['path.after'] = $workspaceRoot->getPath();
            }
        }

        $options['hiddenFilters']['active'] = true;
        $options['hiddenFilters']['resourceTypeEnabled'] = true;

        $roles = DataSource::CONTEXT_HOME === $event->getContext() ?
            ['ROLE_ANONYMOUS'] :
            array_map(
                function ($role) { return $role->getRole(); },
                $this->tokenStorage->getToken()->getRoles()
            );

        if (!in_array('ROLE_ADMIN', $roles)) {
            $options['hiddenFilters']['roles'] = $roles;
        }

        $event->setData($this->finder->search(ResourceNode::class, $options));

        $event->stopPropagation();
    }
854957
protected function getOptions()
	{
		$options = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		/** @var \SimpleXMLElement $option */
		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 = $select->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;
		}

		reset($options);

		return $options;
	}
137392
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
945519
public function getOption($key)
	{
		return (isset($this->options[$key])) ? $this->options[$key] : false;
	}
141032
public function evaluateAttributes($event)
    {
        if (isset($this->attributes[$event->name])) {
            $enumList = $this->attributes[$event->name];
            if ($this->changeOriginal) {
                if ($event->name == ActiveRecord::EVENT_BEFORE_VALIDATE) {
                    foreach ($enumList as $attribute => $values) {
                        $this->enumData[$attribute . 'List'] = $values;
                        $this->enumData[$attribute . 'Name'] = $this->owner->$attribute;
                        $values = array_flip($values);
                        $valueName = isset($values[$this->owner->$attribute]) ? $values[$this->owner->$attribute] : $this->owner->$attribute;
                        $this->enumData[$attribute . 'Value'] = $valueName;
                        $this->owner->$attribute = $valueName;
                    }
                }
                if (in_array($event->name, [ActiveRecord::EVENT_AFTER_FIND, ActiveRecord::EVENT_AFTER_INSERT, ActiveRecord::EVENT_AFTER_UPDATE])) {
                    foreach ($enumList as $attribute => $values) {
                        $this->enumData[$attribute . 'List'] = $values;
                        $this->enumData[$attribute . 'Value'] = $this->owner->$attribute;
                        $valueName = isset($values[$this->owner->$attribute]) ? $values[$this->owner->$attribute] : $this->owner->$attribute;
                        $this->enumData[$attribute . 'Name'] = $valueName;
                        $this->owner->$attribute = $valueName;
                    }
                }
            } else {
                if ($event->name == ActiveRecord::EVENT_AFTER_FIND) {
                    foreach ($enumList as $attribute => $values) {
                        $this->enumData[$attribute . 'List'] = $values;
                        $this->enumData[$attribute . 'Value'] = $this->owner->$attribute;
                        $valueName = isset($values[$this->owner->$attribute]) ? $values[$this->owner->$attribute] : $this->owner->$attribute;
                        $this->enumData[$attribute . 'Name'] = $valueName;
                    }
                }
            }
        }
    }
63941
public function getData(GetDataEvent $event)
    {
        $options = $event->getOptions() ? $event->getOptions() : [];
        $options['hiddenFilters']['status'] = Statusable::STATUS_PUBLISHED;

        if (DataSource::CONTEXT_WORKSPACE === $event->getContext()) {
            $options['hiddenFilters']['workspace'] = $event->getWorkspace()->getUuid();
        } elseif (DataSource::CONTEXT_HOME === $event->getContext()) {
            $options['hiddenFilters']['anonymous'] = true;
        }
        $event->setData(
            $this->finder->search(Post::class, $options)
        );

        $event->stopPropagation();
    }
32762
public function getData(GetDataEvent $event)
    {
        $options = $event->getOptions() ? $event->getOptions() : [];
        $options['hiddenFilters']['moderation'] = false;

        if (DataSource::CONTEXT_WORKSPACE === $event->getContext()) {
            $options['hiddenFilters']['workspace'] = $event->getWorkspace()->getUuid();
        } elseif (DataSource::CONTEXT_HOME === $event->getContext()) {
            $options['hiddenFilters']['anonymous'] = true;
        }
        $event->setData(
            $this->finder->search(Message::class, $options)
        );

        $event->stopPropagation();
    }
612112
private function getOption($option, array $options)
    {
        return isset($options[$option]) ? $options[$option] : $this->$option;
    }
50447
public function rights(ResourceActionEvent $event)
    {
        // forward to the resource type
        $options = [];

        $params = $event->getOptions();

        if (isset($params['recursive']) && 'true' === $params['recursive']) {
            $options[] = Options::IS_RECURSIVE;
        }

        $data = $event->getData();
        $this->crud->update(ResourceNode::class, $data, $options);
        $this->lifecycleManager->rights($event->getResourceNode(), $event->getData());

        $event->setResponse(new JsonResponse(
            $this->serializer->serialize($event->getResourceNode())
        ));
    }
936066
public function getOption($key)
    {
        return (isset($this->_options[$key])) ? $this->_options[$key] : false;
    }
948329
protected function _getOptions()
    {
        if (array_key_exists('name', $this->_properties)) {
            $options = Setting::options($this->_properties['name']);
            if (is_callable($options)) {
                return $options();
            }
            return $options;
        }
        return false;
    }
528909
protected function getOptions(CassandraEvent $event)
    {
        $options = $event->getArguments()[1];

        return [
            'consistency'       => self::getConsistency($options['consistency'] ?? ''),
            'serialConsistency' => self::getConsistency($options['serialConsistency'] ?? ''),
            'pageSize'          => $options['pageSize'] ?? '',
            'timeout'           => $options['timeout'] ?? '',
            'arguments'         => var_export($options['arguments'] ?? '', true)
        ];

    }
1132313
protected function getOptions()
	{
		$options = array();

		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 = HtmlSelect::option(
				(string) $option['value'],
				Text::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), '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;
		}

		reset($options);

		return $options;
	}
728172
public function getArgs($event)
    {
        return [
            $event->getHref(),
            $event->getLabel(),
            $event->getTitle(),
            $event->getClass(),
            $event->getAttributes(),
            $event->getEnvironment()->getDataDefinition()->getName(),
            $event->getEnvironment()->getDataDefinition()->getBasicDefinition()->getRootEntries()
        ];
    }
650745
public function getOptions(GetPropertyOptionsEvent $event)
    {
        if (('range_template' !== $event->getPropertyName())
            || ('tl_metamodel_filtersetting' !== $event->getEnvironment()->getDataDefinition()->getName())
        ) {
            return;
        }

        $event->setOptions($this->templateList->getTemplatesForBase('mm_filteritem_'));
    }
172118
public function evaluateAttributes($event)
    {
        if (!empty($this->attributes[$event->name])) {
            $attributes = (array) $this->attributes[$event->name];
            foreach ($attributes as $attribute) {
                // ignore attribute names which are not string (e.g. when set by TimestampBehavior::updatedAtAttribute)
                if (is_string($attribute)) {
                    $value = $this->getValue($event, $attribute);
                    $this->owner->$attribute = $value;
                }
            }
        }
    }