DatetimeViewsHooks.php

Namespace

Drupal\datetime\Hook

File

core/modules/datetime/src/Hook/DatetimeViewsHooks.php

View source
<?php

namespace Drupal\datetime\Hook;

use Drupal\datetime\DateTimeViewsHelper;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for datetime.
 */
class DatetimeViewsHooks {
  public function __construct(protected readonly DateTimeViewsHelper $dateTimeViewsHelper) {
  }
  
  /**
   * Implements hook_field_views_data().
   */
  public function fieldViewsData(FieldStorageConfigInterface $field_storage) : array {
    return $this->dateTimeViewsHelper
      ->buildViewsData($field_storage, [], $field_storage->getMainPropertyName());
  }

}

Classes

Title Deprecated Summary
DatetimeViewsHooks Hook implementations for datetime.

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