NodeCreated.php

Namespace

Drupal\node\Plugin\views\argument_default

File

core/modules/node/src/Plugin/views/argument_default/NodeCreated.php

View source
<?php

namespace Drupal\node\Plugin\views\argument_default;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\node\NodeInterface;
use Drupal\views\Attribute\ViewsArgumentDefault;

/**
 * Provides the created time of the current node as default argument value.
 */
class NodeCreated extends NodeDateArgumentDefaultPluginBase {
  
  /**
   * {@inheritdoc}
   */
  protected function getNodeDateValue(NodeInterface $node) : int {
    return $node->getCreatedTime();
  }

}

Classes

Title Deprecated Summary
NodeCreated Provides the created time of the current node as default argument value.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.