You are here

public static function Enum::__callStatic in Drupal driver for SQL Server and SQL Azure 7.3

Same name and namespace in other branches
  1. 7.2 sqlsrv/enum.inc \Enum::__callStatic()

Returns a value when called statically like so: MyEnum::SOME_VALUE() given SOME_VALUE is a class constant

Parameters

string $name:

array $arguments:

Return value

static

Throws

\BadMethodCallException

File

sqlsrv/enum.inc, line 137

Class

Enum
Base Enum class

Code

public static function __callStatic($name, $arguments) {
  if (defined("static::{$name}")) {
    return new static(constant("static::{$name}"));
  }
  throw new \BadMethodCallException("No static method or enum constant '{$name}' in class " . get_called_class());
}