SaveEntity.php

Contains \Drupal\action_test\Plugin\Action\SaveEntity.

Namespace

Drupal\action_test\Plugin\Action

File

drupal/core/modules/system/tests/modules/action_test/lib/Drupal/action_test/Plugin/Action/SaveEntity.php
View source
<?php

/**
 * @file
 * Contains \Drupal\action_test\Plugin\Action\SaveEntity.
 */
namespace Drupal\action_test\Plugin\Action;

use Drupal\Core\Annotation\Action;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Action\ActionBase;

/**
 * Provides an operation to save user entities.
 *
 * @Action(
 *   id = "action_test_save_entity",
 *   label = @Translation("Saves entities"),
 *   type = "user"
 * )
 */
class SaveEntity extends ActionBase {

  /**
   * {@inheritdoc}
   */
  public function execute($entity = NULL) {
    $entity
      ->save();
  }

}

Classes

Namesort descending Description
SaveEntity Provides an operation to save user entities.