You are here

public function BlazyAdminBase::getEntityAsOptions in Blazy 8.2

Returns available entities for select options.

3 calls to BlazyAdminBase::getEntityAsOptions()
BlazyAdminBase::baseForm in src/Form/BlazyAdminBase.php
Returns simple form elements common for Views field, EB widget, formatters.
BlazyAdminBase::getOptionsetOptions in src/Form/BlazyAdminBase.php
Returns available optionsets for select options.
BlazyAdminFormatterBase::getExcludedSettingsSummary in src/Form/BlazyAdminFormatterBase.php
Exclude the field formatter settings summary as required.

File

src/Form/BlazyAdminBase.php, line 655

Class

BlazyAdminBase
A base for blazy admin integration to have re-usable methods in one place.

Namespace

Drupal\blazy\Form

Code

public function getEntityAsOptions($entity_type = '') {
  $options = [];
  if ($entities = $this->blazyManager
    ->entityLoadMultiple($entity_type)) {
    foreach ($entities as $entity) {
      $options[$entity
        ->id()] = Html::escape($entity
        ->label());
    }
    ksort($options);
  }
  return $options;
}