You are here

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

Returns all possible values as an array

Return value

array Constant name in key, constant value in value

5 calls to Enum::toArray()
Enum::isValid in drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php
Check if is valid enum value
Enum::isValidKey in drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php
Check if is valid enum key
Enum::keys in drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php
Returns the names (keys) of all constants in the Enum class
Enum::search in drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php
Return key for value
Enum::values in drivers/lib/Drupal/Driver/Database/sqlsrv/Enum.php
Returns instances of the Enum class of all Enum constants

File

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

Class

Enum
Base Enum class

Namespace

Drupal\Driver\Database\sqlsrv

Code

public static function toArray() {
  $class = get_called_class();
  if (!array_key_exists($class, self::$cache)) {
    $reflection = new \ReflectionClass($class);
    self::$cache[$class] = $reflection
      ->getConstants();
  }
  return self::$cache[$class];
}