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

Breadcrumb

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

function MapField::checkKey

@ignore

3 calls to MapField::checkKey()
MapField::offsetExists in vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
Check the existence of the element at the given key.
MapField::offsetSet in vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
Assign the element at the given key.
MapField::offsetUnset in vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php
Remove the element at the given key.

File

vendor/google/protobuf/src/Google/Protobuf/Internal/MapField.php, line 241

Class

MapField
MapField is used by generated protocol message classes to manipulate map fields. It can be used like native PHP array.

Namespace

Google\Protobuf\Internal

Code

private function checkKey($key_type, &$key) {
    switch ($key_type) {
        case GPBType::SFIXED32:
        case GPBType::SINT32:
        case GPBType::INT32:
            GPBUtil::checkInt32($key);
            break;
        case GPBType::FIXED32:
        case GPBType::UINT32:
            GPBUtil::checkUint32($key);
            break;
        case GPBType::SFIXED64:
        case GPBType::SINT64:
        case GPBType::INT64:
            GPBUtil::checkInt64($key);
            break;
        case GPBType::FIXED64:
        case GPBType::UINT64:
            GPBUtil::checkUint64($key);
            break;
        case GPBType::BOOL:
            GPBUtil::checkBool($key);
            break;
        case GPBType::STRING:
            GPBUtil::checkString($key, true);
            break;
        default:
            trigger_error("Given type cannot be map key.", E_USER_ERROR);
            break;
    }
}

API Navigation

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