Mercurial > hg > isophonics-drupal-site
comparison core/modules/node/src/Plugin/Action/PublishNode.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\PublishAction; |
| 6 use Drupal\node\NodeInterface; | 6 use Drupal\Core\Entity\EntityTypeManagerInterface; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Publishes a node. | 9 * Publishes 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\PublishAction instead. | |
| 13 * | |
| 14 * @see \Drupal\Core\Action\Plugin\Action\PublishAction | |
| 15 * @see https://www.drupal.org/node/2919303 | |
| 10 * | 16 * |
| 11 * @Action( | 17 * @Action( |
| 12 * id = "node_publish_action", | 18 * id = "node_publish_action", |
| 13 * label = @Translation("Publish selected content"), | 19 * label = @Translation("Publish selected content"), |
| 14 * type = "node" | 20 * type = "node" |
| 15 * ) | 21 * ) |
| 16 */ | 22 */ |
| 17 class PublishNode extends FieldUpdateActionBase { | 23 class PublishNode extends PublishAction { |
| 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::PUBLISHED]; | 29 parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager); |
| 30 @trigger_error(__NAMESPACE__ . '\PublishNode is deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Use \Drupal\Core\Action\Plugin\Action\PublishAction instead. See https://www.drupal.org/node/2919303.', E_USER_DEPRECATED); | |
| 24 } | 31 } |
| 25 | 32 |
| 26 } | 33 } |
