defineMapping example


  abstract protected function defineMapping();

  /** * {@inheritdoc} */
  protected function defineOptions() {
    $options = parent::defineOptions();

    // Parse the mapping and add a default for each.     foreach ($this->defineMapping() as $key => $value) {
      $default = !empty($value['#multiple']) ? [] : '';
      $options['mapping']['contains'][$key] = [
        'default' => $value['#default_value'] ?? $default,
      ];
      if (!empty($value['#toggle'])) {
        $options['mapping']['contains']["toggle_$key"] = [
          'default' => FALSE,
        ];
      }
    }

    
Home | Imprint | This part of the site doesn't use cookies.