public function DateTimePlus::__call in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/Component/Datetime/DateTimePlus.php \Drupal\Component\Datetime\DateTimePlus::__call()
Implements the magic __call method.
Passes through all unknown calls onto the DateTime object.
File
- lib/
Drupal/ Component/ Datetime/ DateTimePlus.php, line 290 - Contains \Drupal\Component\Datetime\DateTimePlus.
Class
- DateTimePlus
- Wraps DateTime().
Namespace
Drupal\Component\DatetimeCode
public function __call($method, $args) {
// @todo consider using assert() as per https://www.drupal.org/node/2451793.
if (!isset($this->dateTimeObject)) {
throw new \Exception('DateTime object not set.');
}
if (!method_exists($this->dateTimeObject, $method)) {
throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s()', get_class($this), $method));
}
return call_user_func_array(array(
$this->dateTimeObject,
$method,
), $args);
}