function RestResourceConfig::__construct

Same name in other branches
  1. 9 core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::__construct()
  2. 8.9.x core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::__construct()
  3. 11.x core/modules/rest/src/Entity/RestResourceConfig.php \Drupal\rest\Entity\RestResourceConfig::__construct()

Overrides ConfigEntityBase::__construct

File

core/modules/rest/src/Entity/RestResourceConfig.php, line 80

Class

RestResourceConfig
Defines a RestResourceConfig configuration entity class.

Namespace

Drupal\rest\Entity

Code

public function __construct(array $values, $entity_type) {
    parent::__construct($values, $entity_type);
    // The config entity id looks like the plugin id but uses __ instead of :
    // because : is not valid for config entities.
    if (!isset($this->plugin_id) && isset($this->id)) {
        // Generate plugin_id on first entity creation.
        $this->plugin_id = str_replace('.', ':', $this->id);
    }
}

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