public function Editor::__construct

Overrides Drupal\Core\Entity\Entity::__construct()

Overrides ConfigEntityBase::__construct

File

drupal/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php, line 74
Contains \Drupal\editor\Plugin\Core\Entity\Editor.

Class

Editor
Defines the configured text editor entity.

Namespace

Drupal\editor\Plugin\Core\Entity

Code

public function __construct(array $values, $entity_type) {
  parent::__construct($values, $entity_type);
  $manager = drupal_container()
    ->get('plugin.manager.editor');
  $plugin = $manager
    ->createInstance($this->editor);

  // Initialize settings, merging module-provided defaults.
  $default_settings = $plugin
    ->getDefaultSettings();
  $default_settings += module_invoke_all('editor_default_settings', $this->editor);
  drupal_alter('editor_default_settings', $default_settings, $this->editor);
  $this->settings += $default_settings;
}