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 / DescriptorPool.php

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

48 lines 1.4 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 class DescriptorPool
12 {
13 private static $pool;
14 private $internal_pool;
15 /**
16 * @return DescriptorPool
17 */
18 public static function getGeneratedPool()
19 {
20 if (!isset(self::$pool)) {
21 self::$pool = new DescriptorPool(\Dudlewebs\WPMCS\Google\Protobuf\Internal\DescriptorPool::getGeneratedPool());
22 }
23 return self::$pool;
24 }
25 private function __construct($internal_pool)
26 {
27 $this->internal_pool = $internal_pool;
28 }
29 /**
30 * @param string $className A fully qualified protobuf class name
31 * @return Descriptor
32 */
33 public function getDescriptorByClassName($className)
34 {
35 $desc = $this->internal_pool->getDescriptorByClassName($className);
36 return is_null($desc) ? null : $desc->getPublicDescriptor();
37 }
38 /**
39 * @param string $className A fully qualified protobuf class name
40 * @return EnumDescriptor
41 */
42 public function getEnumDescriptorByClassName($className)
43 {
44 $desc = $this->internal_pool->getEnumDescriptorByClassName($className);
45 return is_null($desc) ? null : $desc->getPublicDescriptor();
46 }
47 }
48