RestResourceConfig::__construct

public RestResourceConfig::__construct(array $values, $entity_type)

Constructs an Entity object.

Parameters

array $values: An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

string $entity_type: The type of the entity to create.

Overrides ConfigEntityBase::__construct

File

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

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);
  }
}
doc_Drupal
2016-10-29 09:38:21
Comments
Leave a Comment

Please login to continue.