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\InternalCode
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;
}
}