datetime.module

Same filename in other branches
  1. 9 core/modules/datetime/datetime.module
  2. 8.9.x core/modules/datetime/datetime.module
  3. 10 core/modules/datetime/datetime.module

Holds datetime views field data helper for deprecation.

File

core/modules/datetime/datetime.module

View source
<?php


/**
 * @file
 * Holds datetime views field data helper for deprecation.
 */
use Drupal\field\FieldStorageConfigInterface;

/**
 * Provides Views integration for any datetime-based fields.
 *
 * Overrides the default Views data for datetime-based fields, adding datetime
 * views plugins. Modules defining new datetime-based fields may use this
 * function to simplify Views integration.
 *
 * @param \Drupal\field\FieldStorageConfigInterface $field_storage
 *   The field storage config entity.
 * @param array $data
 *   Field view data or FieldViewsDataProvider::defaultFieldImplementation($field_storage) if empty.
 * @param string $column_name
 *   The schema column name with the datetime value.
 *
 * @return array
 *   The array of field views data with the datetime plugin.
 *
 * @see datetime_field_views_data()
 * @see datetime_range_field_views_data()
 *
 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use
 * \Drupal::service('datetime.views_helper')
 * ->fieldViewsDataHelper($field_storage, $data, $column_name); instead.
 * @see https://www.drupal.org/node/3489502
 */
function datetime_type_field_views_data_helper(FieldStorageConfigInterface $field_storage, array $data, $column_name) {
    @trigger_error('datetime_type_field_views_data_helper() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \\Drupal::service(\'datetime.views_helper\')->fieldViewsDataHelper($field_storage, $data, $column_name). See https://www.drupal.org/node/3489502', E_USER_DEPRECATED);
    return \Drupal::service('datetime.views_helper')->fieldViewsDataHelper($field_storage, $data, $column_name);
}

Functions

Title Deprecated Summary
datetime_type_field_views_data_helper

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal::service('datetime.views_helper') ->fieldViewsDataHelper($field_storage, $data, $column_name); instead.

Provides Views integration for any datetime-based fields.

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