You are here

public function Template::save in Wysiwyg API template plugin 8.2

Same name and namespace in other branches
  1. 3.0.x src/Entity/Template.php \Drupal\wysiwyg_template\Entity\Template::save()

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown.

Overrides ConfigEntityBase::save

File

src/Entity/Template.php, line 128

Class

Template
Defines the Template entity.

Namespace

Drupal\wysiwyg_template\Entity

Code

public function save() {
  $this->node_types = array_values(array_filter($this
    ->getNodeTypes()));
  parent::save();
}