Get special labels.

@param PropertyInterface $propInfo The property for which the X label shall be generated.
@param ModelInterface    $model    The model.

@return array
420275
protected function getOptionsForWidget($propInfo, $model): ?array
    {
        if (!$this->isGetOptionsAllowed($propInfo)) {
            return null;
        }

        $environment = $this->getEnvironment();
        $options     = $propInfo->getOptions();
        $event       = new GetPropertyOptionsEvent($environment, $model);
        $event->setPropertyName($propInfo->getName());
        $event->setOptions($options);
        $environment->getEventDispatcher()->dispatch(GetPropertyOptionsEvent::NAME, $event);

        if ($event->getOptions() !== $options) {
            return $event->getOptions();
        }

        return $options;
    }
175903
public function identifyEntity(ModelInterface $model, &$entity, $identifier)
    {
        $primaryKeys = $model->primaryFields();
        if (count($primaryKeys) !== 1) {
            return;
        }

        $field = reset($primaryKeys)->name();

        $this->setPropertyValue($entity, $field, $identifier);
    }
1282588
protected function getField(IFormModel $model, $property)
    {
        $cl = get_class($model);
        $smallName = substr($cl, strrpos($cl, '\\') + 1);

        return [
            'id' => $smallName.'_'.$property,
            'name' => $smallName.'['.$property.']',
            'value' => property_exists($model, $property) ? $model->$property : null
        ];
    }
962055
public function getLabeledPropertiesToBeSet($object)
    {
        return array_filter($this->getLabeledProperties(), function (LabeledPropertyMetadata $labeledPropertyMetadata) use ($object) {
            return true === $labeledPropertyMetadata->getValue($object);
        });
    }
359563
protected function getMetaModel(ModelInterface $model)
    {
        $filterSetting = $this->filterSettingFactory->createCollection($model->getProperty('fid'));

        return $filterSetting->getMetaModel();
    }
543214
private function getItems(PropertyInterface $property)
    {
        $value = $this->getValue($property);
        if (!is_array($value['items']) || 0 === count($value['items'])) {
            return [];
        }

        return $value['items'];
    }
344827
private function presentationModel(PresentationModel $presentationModel, string $label = ''): void
    {
        if ($label === '') {
            $label = $presentationModel->getName();
        }

        $this->group($label, false);
        $this->value($presentationModel->getName(), 'name');

        if ($presentationModel instanceof HasPresenterInterface) {
            $this->value($presentationModel->getPresenterName(), 'presenter');
        }

        $this->iterable($presentationModel->getVariables(), 'variables');
        $this->groupEnd();
    }
293377
protected function getPropertyLabel(EnvironmentInterface $environment, PropertyInterface $property)
    {
        $translator = $environment->getTranslator();

        $label = $translator->translate($property->getLabel(), $environment->getDataDefinition()->getName());
        if (!$label) {
            $label = $translator->translate('MSC.' . $property->getName());
        }

        if (\is_array($label)) {
            $label = $label[0];
        }

        if (!$label) {
            $label = $property->getName();
        }

        return $label;
    }
625670
public function getValue(ModelInterface $model)
    {
        $references = parent::getValue($model);

        $result = array();
        foreach ($references as $key => $reference) {
            $result[$key] = array('hash' => $reference->getHash(), 'class' => $reference->getClass());
        }

        return $result;
    }
144476
private function booleanInput(PropertyInterface $prop, $label)
    {
        $climate = $this->climate();

        $opts = [
            1 => $prop->trueLabel(),
            0 => $prop->falseLabel()
        ];
        $input = $climate->radio(
            $label,
            $opts
        );
        return $input;
    }
124380
public function getPropertiesFromApi(array $propRefs) {
    $searchRequest = [
      'reference' => implode(',', $propRefs),
    ];

    $api_response = $this->nt8RestService->get(
      'property', $searchRequest
    );

    $decoded_api_response = json_decode($api_response);

    if (isset($decoded_api_response->errorCode)) {
      \Drupal::logger('NT8PropertyService')->error(
        "Tabs property search returned an error: \r\n @tabsErrorCode: @tabsErrorMessage.",
        [
          '@tabsErrorCode' => $decoded_api_response->errorCode,
          '@tabsErrorMessage' => $decoded_api_response->errorDescription ?: 'No Description Provided',
        ]
      );
    }

    return $decoded_api_response->results ?? NULL;
  }
930444
private function getPropertyTypes(ObjectInterface $object, $index)
    {
        $objectClass = get_class($object);

        if (!array_key_exists($objectClass, $this->reflectionCache) || !array_key_exists($index,
                $this->reflectionCache[$objectClass])) {

            $propertyTypes = $this->PropertyInfoExtractor->getTypes($objectClass, $index);

            $this->reflectionCache[$objectClass][$index] = $propertyTypes;
        } else {
            $propertyTypes = $this->reflectionCache[$objectClass][$index];
        }

        return $propertyTypes;
    }
400046
protected function getModelRepositoryForInformation(ModelInformationInterface $information)
    {
        /** @var ModelRepositoryFactoryInterface $factory */
        $factory = app(ModelRepositoryFactoryInterface::class);

        $modelRepository = $factory->make($information->modelClass());

        $this->applyRepositoryContext($modelRepository, $information);

        return $modelRepository;
    }
139652
public function getLabel()
    {
        if (property_exists($this, '_label_column')) {
            if (property_exists($this, $this->_label_column)) {
                $label_column = $this->_label_column;
                return $this->$label_column;
            }
        }
        if (property_exists($this, 'name')) {
            return $this->name;
        }
        if (property_exists($this, 'description')) {
            return $this->description;
        }
        return "No label for " . get_called_class() . " ID " . $this->getId();
    }
1255123
public function transform(FieldTypeInterface $field)
    {
        return [
            'attributes' => $field->getAttributes(),
            'basename' => $field->getBaseName(),
            'component' => $field->getComponent(),
            'data_type' => $field->getOption('data_type', ''),
            'default' => $field->getOption('data', ''),
            'name' => $field->getName(),
            'options' => $this->getOptions($field),
            'label' => [
                'inner' => $field->getOption('label'),
                'attributes' => $field->getOption('label_attr', [])
            ],
            'theme' => $field->getTheme(),
            'type' => $field->getType(),
            'validation' => [
                'errors' => $field->getOption('errors', true),
                'messages' => $field->errors()->toArray(),
                'placeholder' => $field->getOption('placeholder'),
                'rules' => $field->getOption('rules', '')
            ],
            'value' => 'checkbox' === $field->getType() ? $field->getRawValue() : $field->getValue(''),
        ];
    }
661227
protected function configureLabel(
        LabelAwareInterface $element,
        array $spec = []
    ): LabelAwareInterface {

        if (isset($spec['label'])) {
            $element->withLabel($spec['label']);
        }
        if (isset($spec['label_attributes']) && is_array($spec['label_attributes'])) {
            $element->withLabelAttributes($spec['label_attributes']);
        }

        return $element;
    }
599366
private String getPropertyLabel(PropertyIdValue propertyIdValue) {
		PropertyRecord propertyRecord = this.propertyRecords
				.get(propertyIdValue);
		if (propertyRecord == null || propertyRecord.propertyDocument == null) {
			return propertyIdValue.getId();
		} else {
			return getLabel(propertyIdValue, propertyRecord.propertyDocument);
		}
	}