You are here

public function Enum::__construct in Drupal driver for SQL Server and SQL Azure 8.2

Creates a new value of some type

Parameters

mixed $value:

Throws

UnexpectedValueException

File

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

Class

Enum
Enum class.

Namespace

Drupal\Driver\Database\sqlsrv\Component

Code

public function __construct($value) {
  if (!$this
    ->isValid($value)) {
    throw new UnexpectedValueException("Value '{$value}' is not part of the enum " . get_called_class());
  }
  $this->value = $value;
}