Mercurial > hg > isophonics-drupal-site
annotate core/modules/node/src/Plugin/Action/StickyNode.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
| author | Chris Cannam |
|---|---|
| date | Fri, 23 Feb 2018 15:52:07 +0000 |
| parents | 4c8ae668cc8c |
| children |
| rev | line source |
|---|---|
| Chris@0 | 1 <?php |
| Chris@0 | 2 |
| Chris@0 | 3 namespace Drupal\node\Plugin\Action; |
| Chris@0 | 4 |
| Chris@0 | 5 use Drupal\Core\Field\FieldUpdateActionBase; |
| Chris@0 | 6 use Drupal\node\NodeInterface; |
| Chris@0 | 7 |
| Chris@0 | 8 /** |
| Chris@0 | 9 * Makes a node sticky. |
| Chris@0 | 10 * |
| Chris@0 | 11 * @Action( |
| Chris@0 | 12 * id = "node_make_sticky_action", |
| Chris@0 | 13 * label = @Translation("Make selected content sticky"), |
| Chris@0 | 14 * type = "node" |
| Chris@0 | 15 * ) |
| Chris@0 | 16 */ |
| Chris@0 | 17 class StickyNode extends FieldUpdateActionBase { |
| Chris@0 | 18 |
| Chris@0 | 19 /** |
| Chris@0 | 20 * {@inheritdoc} |
| Chris@0 | 21 */ |
| Chris@0 | 22 protected function getFieldsToUpdate() { |
| Chris@0 | 23 return ['sticky' => NodeInterface::STICKY]; |
| Chris@0 | 24 } |
| Chris@0 | 25 |
| Chris@0 | 26 } |
