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

Breadcrumb

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

function DateTimePlus::__callStatic

Implements the magic __callStatic method.

Passes through all unknown static calls onto the DateTime object.

File

core/lib/Drupal/Component/Datetime/DateTimePlus.php, line 400

Class

DateTimePlus
Wraps DateTime().

Namespace

Drupal\Component\Datetime

Code

public static function __callStatic($method, $args) {
    if (!method_exists('\\DateTime', $method)) {
        throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', static::class, $method));
    }
    return call_user_func_array([
        '\\DateTime',
        $method,
    ], $args);
}

API Navigation

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