Mercurial > hg > isophonics-drupal-site
comparison core/modules/node/src/Plugin/Action/UnpublishNode.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\node\Plugin\Action; | 3 namespace Drupal\node\Plugin\Action; |
4 | 4 |
5 use Drupal\Core\Field\FieldUpdateActionBase; | 5 use Drupal\Core\Action\Plugin\Action\UnpublishAction; |
6 use Drupal\node\NodeInterface; | 6 use Drupal\Core\Entity\EntityTypeManagerInterface; |
7 | 7 |
8 /** | 8 /** |
9 * Unpublishes a node. | 9 * Unpublishes a node. |
10 * | |
11 * @deprecated in Drupal 8.5.x, to be removed before Drupal 9.0.0. | |
12 * Use \Drupal\Core\Action\Plugin\Action\UnpublishAction instead. | |
13 * | |
14 * @see \Drupal\Core\Action\Plugin\Action\UnpublishAction | |
15 * @see https://www.drupal.org/node/2919303 | |
10 * | 16 * |
11 * @Action( | 17 * @Action( |
12 * id = "node_unpublish_action", | 18 * id = "node_unpublish_action", |
13 * label = @Translation("Unpublish selected content"), | 19 * label = @Translation("Unpublish selected content"), |
14 * type = "node" | 20 * type = "node" |
15 * ) | 21 * ) |
16 */ | 22 */ |
17 class UnpublishNode extends FieldUpdateActionBase { | 23 class UnpublishNode extends UnpublishAction { |
18 | 24 |
19 /** | 25 /** |
20 * {@inheritdoc} | 26 * {@inheritdoc} |
21 */ | 27 */ |
22 protected function getFieldsToUpdate() { | 28 public function __construct($configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) { |
23 return ['status' => NodeInterface::NOT_PUBLISHED]; | 29 parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager); |
30 @trigger_error(__NAMESPACE__ . '\UnpublishNode is deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Use \Drupal\Core\Action\Plugin\Action\UnpublishAction instead. See https://www.drupal.org/node/2919303.', E_USER_DEPRECATED); | |
24 } | 31 } |
25 | 32 |
26 } | 33 } |