You are here

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

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

drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php, line 139

Class

Enum
Base Enum class

Namespace

Drupal\Driver\Database\sqlsrv

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());
}