function ConfigEntityType::getPropertiesToExport

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getPropertiesToExport()
  2. 8.9.x core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getPropertiesToExport()
  3. 10 core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php \Drupal\Core\Config\Entity\ConfigEntityType::getPropertiesToExport()

Overrides ConfigEntityTypeInterface::getPropertiesToExport

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityType.php, line 151

Class

ConfigEntityType
Provides an implementation of a configuration entity type and its metadata.

Namespace

Drupal\Core\Config\Entity

Code

public function getPropertiesToExport($id = NULL) {
    // @todo https://www.drupal.org/project/drupal/issues/3113620 Make the
    //   config_export annotation required earlier, remove the possibility of
    //   returning NULL and deprecate the $id argument.
    if (!empty($this->mergedConfigExport)) {
        return $this->mergedConfigExport;
    }
    if (!empty($this->config_export)) {
        // Always add default properties to be exported.
        $this->mergedConfigExport = [
            'uuid' => 'uuid',
            'langcode' => 'langcode',
            'status' => 'status',
            'dependencies' => 'dependencies',
            'third_party_settings' => 'third_party_settings',
            '_core' => '_core',
        ];
        foreach ($this->config_export as $property => $name) {
            if (is_numeric($property)) {
                $this->mergedConfigExport[$name] = $name;
            }
            else {
                $this->mergedConfigExport[$property] = $name;
            }
        }
    }
    else {
        return NULL;
    }
    return $this->mergedConfigExport;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.