Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NullValue.php

class NullValue

`NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.

Protobuf type <code>google.protobuf.NullValue</code>

Hierarchy

  • class \Google\Protobuf\NullValue

Expanded class hierarchy of NullValue

1 file declares its use of NullValue
Message.php in vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php

File

vendor/google/protobuf/src/Google/Protobuf/NullValue.php, line 16

Namespace

Google\Protobuf
View source
class NullValue {
    
    /**
     * Null value.
     *
     * Generated from protobuf enum <code>NULL_VALUE = 0;</code>
     */
    const NULL_VALUE = 0;
    private static $valueToName = [
        self::NULL_VALUE => 'NULL_VALUE',
    ];
    public static function name($value) {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf('Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }
    public static function value($name) {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf('Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }

}

Members

Title Sort descending Modifiers Object type Summary
NullValue::$valueToName private static property
NullValue::name public static function
NullValue::NULL_VALUE constant Null value.
NullValue::value public static function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal