Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RestResourceConfig.php

function RestResourceConfig::__construct

Overrides ConfigEntityBase::__construct

File

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

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);
    }
}
RSS feed
Powered by Drupal