You are here

public static function DateTimePlus::__callStatic in Service Container 7.2

Same name and namespace in other branches
  1. 7 lib/Drupal/Component/Datetime/DateTimePlus.php \Drupal\Component\Datetime\DateTimePlus::__callStatic()

Implements the magic __callStatic method.

Passes through all unknown static calls onto the DateTime object.

File

lib/Drupal/Component/Datetime/DateTimePlus.php, line 306
Contains \Drupal\Component\Datetime\DateTimePlus.

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()', get_called_class(), $method));
  }
  return call_user_func_array(array(
    '\\DateTime',
    $method,
  ), $args);
}