PluginProbe
Media Cloud Sync / 1.0.1
Media Cloud Sync v1.0.1
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
media-cloud-sync / includes / sdk / google / google / protobuf / src / Google / Protobuf / OneofDescriptor.php

OneofDescriptor.php in Media Cloud Sync 1.0.1, at includes/sdk/google/google/protobuf/src/Google/Protobuf/OneofDescriptor.php

54 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Protocol Buffers - Google's data interchange format
4 // Copyright 2017 Google Inc. All rights reserved.
5 //
6 // Use of this source code is governed by a BSD-style
7 // license that can be found in the LICENSE file or at
8 // https://developers.google.com/open-source/licenses/bsd
9 namespace Dudlewebs\WPMCS\Google\Protobuf;
10
11 use Dudlewebs\WPMCS\Google\Protobuf\Internal\GetPublicDescriptorTrait;
12 class OneofDescriptor
13 {
14 use GetPublicDescriptorTrait;
15 /** @var \Google\Protobuf\Internal\OneofDescriptor $internal_desc */
16 private $internal_desc;
17 /**
18 * @internal
19 */
20 public function __construct($internal_desc)
21 {
22 $this->internal_desc = $internal_desc;
23 }
24 /**
25 * @return string The name of the oneof
26 */
27 public function getName()
28 {
29 return $this->internal_desc->getName();
30 }
31 /**
32 * @param int $index Must be >= 0 and < getFieldCount()
33 * @return FieldDescriptor
34 */
35 public function getField($index)
36 {
37 if (is_null($this->internal_desc->getFields()) || !isset($this->internal_desc->getFields()[$index])) {
38 return null;
39 }
40 return $this->getPublicDescriptor($this->internal_desc->getFields()[$index]);
41 }
42 /**
43 * @return int Number of fields in the oneof
44 */
45 public function getFieldCount()
46 {
47 return count($this->internal_desc->getFields());
48 }
49 public function isSynthetic()
50 {
51 return $this->internal_desc->isSynthetic();
52 }
53 }
54