You are here

PromoteNode.php in Drupal 8

Same filename and directory in other branches
  1. 9 core/modules/node/src/Plugin/Action/PromoteNode.php

File

core/modules/node/src/Plugin/Action/PromoteNode.php
View source
<?php

namespace Drupal\node\Plugin\Action;

use Drupal\Core\Field\FieldUpdateActionBase;
use Drupal\node\NodeInterface;

/**
 * Promotes a node.
 *
 * @Action(
 *   id = "node_promote_action",
 *   label = @Translation("Promote selected content to front page"),
 *   type = "node"
 * )
 */
class PromoteNode extends FieldUpdateActionBase {

  /**
   * {@inheritdoc}
   */
  protected function getFieldsToUpdate() {
    return [
      'promote' => NodeInterface::PROMOTED,
    ];
  }

}

Classes

Namesort descending Description
PromoteNode Promotes a node.