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

Breadcrumb

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

class Descriptor

Same name in this branch
  1. 11.1.x vendor/google/protobuf/src/Google/Protobuf/Internal/Descriptor.php \Google\Protobuf\Internal\Descriptor
  2. 11.1.x vendor/google/protobuf/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php \GPBMetadata\Google\Protobuf\Internal\Descriptor
  3. 11.1.x vendor/symfony/console/Descriptor/Descriptor.php \Symfony\Component\Console\Descriptor\Descriptor

Hierarchy

  • class \Google\Protobuf\Descriptor uses \Google\Protobuf\Internal\GetPublicDescriptorTrait

Expanded class hierarchy of Descriptor

1 file declares its use of Descriptor
ProtobufSerializer.php in vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php
1 string reference to 'Descriptor'
DescriptorHelper::getName in vendor/symfony/console/Helper/DescriptorHelper.php
Returns the canonical name of this helper.

File

vendor/google/protobuf/src/Google/Protobuf/Descriptor.php, line 14

Namespace

Google\Protobuf
View source
class Descriptor {
    use GetPublicDescriptorTrait;
    private $internal_desc;
    
    /**
     * @internal
     */
    public function __construct($internal_desc) {
        $this->internal_desc = $internal_desc;
    }
    
    /**
     * @return string Full protobuf message name
     */
    public function getFullName() {
        return trim($this->internal_desc
            ->getFullName(), ".");
    }
    
    /**
     * @return string PHP class name
     */
    public function getClass() {
        return $this->internal_desc
            ->getClass();
    }
    
    /**
     * @param int $index Must be >= 0 and < getFieldCount()
     * @return FieldDescriptor
     */
    public function getField($index) {
        return $this->getPublicDescriptor($this->internal_desc
            ->getFieldByIndex($index));
    }
    
    /**
     * @return int Number of fields in message
     */
    public function getFieldCount() {
        return count($this->internal_desc
            ->getField());
    }
    
    /**
     * @param int $index Must be >= 0 and < getOneofDeclCount()
     * @return OneofDescriptor
     */
    public function getOneofDecl($index) {
        return $this->getPublicDescriptor($this->internal_desc
            ->getOneofDecl()[$index]);
    }
    
    /**
     * @return int Number of oneofs in message
     */
    public function getOneofDeclCount() {
        return count($this->internal_desc
            ->getOneofDecl());
    }
    
    /**
     * @return int Number of real oneofs in message
     */
    public function getRealOneofDeclCount() {
        return $this->internal_desc
            ->getRealOneofDeclCount();
    }

}

Members

Title Sort descending Modifiers Object type Summary
Descriptor::$internal_desc private property
Descriptor::getClass public function
Descriptor::getField public function
Descriptor::getFieldCount public function
Descriptor::getFullName public function
Descriptor::getOneofDecl public function
Descriptor::getOneofDeclCount public function
Descriptor::getRealOneofDeclCount public function
Descriptor::__construct public function @internal
GetPublicDescriptorTrait::getPublicDescriptor private function
RSS feed
Powered by Drupal