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

Breadcrumb

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

function DescriptorPool::crossLink

2 calls to DescriptorPool::crossLink()
DescriptorPool::finish in vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php
DescriptorPool::internalAddGeneratedFile in vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php

File

vendor/google/protobuf/src/Google/Protobuf/Internal/DescriptorPool.php, line 127

Class

DescriptorPool

Namespace

Google\Protobuf\Internal

Code

private function crossLink(Descriptor $desc) {
    foreach ($desc->getField() as $field) {
        switch ($field->getType()) {
            case GPBType::MESSAGE:
                $proto = $field->getMessageType();
                if ($proto[0] == '.') {
                    $proto = substr($proto, 1);
                }
                $subdesc = $this->getDescriptorByProtoName($proto);
                if (is_null($subdesc)) {
                    trigger_error('proto not added: ' . $proto . " for " . $desc->getFullName(), E_USER_ERROR);
                }
                $field->setMessageType($subdesc);
                break;
            case GPBType::ENUM:
                $proto = $field->getEnumType();
                if ($proto[0] == '.') {
                    $proto = substr($proto, 1);
                }
                $field->setEnumType($this->getEnumDescriptorByProtoName($proto));
                break;
            default:
                break;
        }
    }
    unset($field);
    foreach ($desc->getNestedType() as $nested_type) {
        $this->crossLink($nested_type);
    }
    unset($nested_type);
}

API Navigation

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