Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DateTimeComputed.php

function DateTimeComputed::__construct

Overrides TypedData::__construct

File

core/modules/datetime/src/DateTimeComputed.php, line 30

Class

DateTimeComputed
A computed property for dates of date time field items.

Namespace

Drupal\datetime

Code

public function __construct(DataDefinitionInterface $definition, $name = NULL, ?TypedDataInterface $parent = NULL) {
    parent::__construct($definition, $name, $parent);
    if (!$definition->getSetting('date source')) {
        throw new \InvalidArgumentException("The definition's 'date source' key has to specify the name of the date property to be computed.");
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal