You are here

protected function EntityExportCsvTrait::getElementPropertyValue in Entity Export CSV 8

Get element property value.

Parameters

array|string $property: The property.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

mixed $default: The default value.

Return value

array|mixed|null The property value.

2 calls to EntityExportCsvTrait::getElementPropertyValue()
EntityExportCsv::buildForm in src/Form/EntityExportCsv.php
Form constructor.
EntityExportCsvForm::form in src/Form/EntityExportCsvForm.php
Gets the actual form array to be built.

File

src/Form/EntityExportCsvTrait.php, line 111

Class

EntityExportCsvTrait
Provides a trait for Entity Export Csv form.

Namespace

Drupal\entity_export_csv\Form

Code

protected function getElementPropertyValue($property, FormStateInterface $form_state, $default = '', $triggering_element = NULL) {
  if (!empty($triggering_element['#name']) && $triggering_element['#name'] === 'bundle') {
    return $default;
  }
  return $form_state
    ->hasValue($property) ? $form_state
    ->getValue($property) : $default;
}