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

Breadcrumb

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

function AnyBase::is

This method returns whether the type_url in any_message is corresponded to the given class.

Parameters

string $klass The fully qualified PHP class name of a proto message type.:

File

vendor/google/protobuf/src/Google/Protobuf/Internal/AnyBase.php, line 78

Class

AnyBase
Base class for Google\Protobuf\Any, this contains hand-written convenience methods like pack() and unpack().

Namespace

Google\Protobuf\Internal

Code

public function is($klass) {
    $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
    $desc = $pool->getDescriptorByClassName($klass);
    $fully_qualified_name = $desc->getFullName();
    $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualified_name;
    return $this->type_url === $type_url;
}

API Navigation

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