test.pb.php 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: test.proto
  4. namespace Foo;
  5. require_once('test_include.pb.php');
  6. use Google\Protobuf\Internal\DescriptorPool;
  7. use Google\Protobuf\Internal\GPBType;
  8. use Google\Protobuf\Internal\RepeatedField;
  9. use Google\Protobuf\Internal\GPBUtil;
  10. class TestMessage extends \Google\Protobuf\Internal\Message
  11. {
  12. private $optional_int32 = 0;
  13. private $optional_int64 = 0;
  14. private $optional_uint32 = 0;
  15. private $optional_uint64 = 0;
  16. private $optional_sint32 = 0;
  17. private $optional_sint64 = 0;
  18. private $optional_fixed32 = 0;
  19. private $optional_fixed64 = 0;
  20. private $optional_sfixed32 = 0;
  21. private $optional_sfixed64 = 0;
  22. private $optional_float = 0.0;
  23. private $optional_double = 0.0;
  24. private $optional_bool = false;
  25. private $optional_string = '';
  26. private $optional_bytes = '';
  27. private $optional_enum = 0;
  28. private $optional_message = null;
  29. private $optional_included_message = null;
  30. private $recursive = null;
  31. private $repeated_int32;
  32. private $repeated_int64;
  33. private $repeated_uint32;
  34. private $repeated_uint64;
  35. private $repeated_sint32;
  36. private $repeated_sint64;
  37. private $repeated_fixed32;
  38. private $repeated_fixed64;
  39. private $repeated_sfixed32;
  40. private $repeated_sfixed64;
  41. private $repeated_float;
  42. private $repeated_double;
  43. private $repeated_bool;
  44. private $repeated_string;
  45. private $repeated_bytes;
  46. private $repeated_enum;
  47. private $repeated_message;
  48. private $repeated_recursive;
  49. private $map_int32_int32;
  50. private $map_int64_int64;
  51. private $map_uint32_uint32;
  52. private $map_uint64_uint64;
  53. private $map_sint32_sint32;
  54. private $map_sint64_sint64;
  55. private $map_fixed32_fixed32;
  56. private $map_fixed64_fixed64;
  57. private $map_sfixed32_sfixed32;
  58. private $map_sfixed64_sfixed64;
  59. private $map_int32_float;
  60. private $map_int32_double;
  61. private $map_bool_bool;
  62. private $map_string_string;
  63. private $map_int32_bytes;
  64. private $map_int32_enum;
  65. private $map_int32_message;
  66. private $map_recursive;
  67. protected $my_oneof;
  68. public function getOptionalInt32()
  69. {
  70. return $this->optional_int32;
  71. }
  72. public function setOptionalInt32($var)
  73. {
  74. GPBUtil::checkInt32($var);
  75. $this->optional_int32 = $var;
  76. }
  77. public function getOptionalInt64()
  78. {
  79. return $this->optional_int64;
  80. }
  81. public function setOptionalInt64($var)
  82. {
  83. GPBUtil::checkInt64($var);
  84. $this->optional_int64 = $var;
  85. }
  86. public function getOptionalUint32()
  87. {
  88. return $this->optional_uint32;
  89. }
  90. public function setOptionalUint32($var)
  91. {
  92. GPBUtil::checkUint32($var);
  93. $this->optional_uint32 = $var;
  94. }
  95. public function getOptionalUint64()
  96. {
  97. return $this->optional_uint64;
  98. }
  99. public function setOptionalUint64($var)
  100. {
  101. GPBUtil::checkUint64($var);
  102. $this->optional_uint64 = $var;
  103. }
  104. public function getOptionalSint32()
  105. {
  106. return $this->optional_sint32;
  107. }
  108. public function setOptionalSint32($var)
  109. {
  110. GPBUtil::checkInt32($var);
  111. $this->optional_sint32 = $var;
  112. }
  113. public function getOptionalSint64()
  114. {
  115. return $this->optional_sint64;
  116. }
  117. public function setOptionalSint64($var)
  118. {
  119. GPBUtil::checkInt64($var);
  120. $this->optional_sint64 = $var;
  121. }
  122. public function getOptionalFixed32()
  123. {
  124. return $this->optional_fixed32;
  125. }
  126. public function setOptionalFixed32($var)
  127. {
  128. GPBUtil::checkUint32($var);
  129. $this->optional_fixed32 = $var;
  130. }
  131. public function getOptionalFixed64()
  132. {
  133. return $this->optional_fixed64;
  134. }
  135. public function setOptionalFixed64($var)
  136. {
  137. GPBUtil::checkUint64($var);
  138. $this->optional_fixed64 = $var;
  139. }
  140. public function getOptionalSfixed32()
  141. {
  142. return $this->optional_sfixed32;
  143. }
  144. public function setOptionalSfixed32($var)
  145. {
  146. GPBUtil::checkInt32($var);
  147. $this->optional_sfixed32 = $var;
  148. }
  149. public function getOptionalSfixed64()
  150. {
  151. return $this->optional_sfixed64;
  152. }
  153. public function setOptionalSfixed64($var)
  154. {
  155. GPBUtil::checkInt64($var);
  156. $this->optional_sfixed64 = $var;
  157. }
  158. public function getOptionalFloat()
  159. {
  160. return $this->optional_float;
  161. }
  162. public function setOptionalFloat($var)
  163. {
  164. GPBUtil::checkFloat($var);
  165. $this->optional_float = $var;
  166. }
  167. public function getOptionalDouble()
  168. {
  169. return $this->optional_double;
  170. }
  171. public function setOptionalDouble($var)
  172. {
  173. GPBUtil::checkDouble($var);
  174. $this->optional_double = $var;
  175. }
  176. public function getOptionalBool()
  177. {
  178. return $this->optional_bool;
  179. }
  180. public function setOptionalBool($var)
  181. {
  182. GPBUtil::checkBool($var);
  183. $this->optional_bool = $var;
  184. }
  185. public function getOptionalString()
  186. {
  187. return $this->optional_string;
  188. }
  189. public function setOptionalString($var)
  190. {
  191. GPBUtil::checkString($var, True);
  192. $this->optional_string = $var;
  193. }
  194. public function getOptionalBytes()
  195. {
  196. return $this->optional_bytes;
  197. }
  198. public function setOptionalBytes($var)
  199. {
  200. GPBUtil::checkString($var, False);
  201. $this->optional_bytes = $var;
  202. }
  203. public function getOptionalEnum()
  204. {
  205. return $this->optional_enum;
  206. }
  207. public function setOptionalEnum($var)
  208. {
  209. GPBUtil::checkEnum($var, \Foo\TestEnum::class);
  210. $this->optional_enum = $var;
  211. }
  212. public function getOptionalMessage()
  213. {
  214. return $this->optional_message;
  215. }
  216. public function setOptionalMessage(&$var)
  217. {
  218. GPBUtil::checkMessage($var, \Foo\TestMessage_Sub::class);
  219. $this->optional_message = $var;
  220. }
  221. public function getOptionalIncludedMessage()
  222. {
  223. return $this->optional_included_message;
  224. }
  225. public function setOptionalIncludedMessage(&$var)
  226. {
  227. GPBUtil::checkMessage($var, \Bar\TestInclude::class);
  228. $this->optional_included_message = $var;
  229. }
  230. public function getRecursive()
  231. {
  232. return $this->recursive;
  233. }
  234. public function setRecursive(&$var)
  235. {
  236. GPBUtil::checkMessage($var, \Foo\TestMessage::class);
  237. $this->recursive = $var;
  238. }
  239. public function getRepeatedInt32()
  240. {
  241. return $this->repeated_int32;
  242. }
  243. public function setRepeatedInt32(&$var)
  244. {
  245. GPBUtil::checkRepeatedField($var, GPBType::INT32);
  246. $this->repeated_int32 = $var;
  247. }
  248. public function getRepeatedInt64()
  249. {
  250. return $this->repeated_int64;
  251. }
  252. public function setRepeatedInt64(&$var)
  253. {
  254. GPBUtil::checkRepeatedField($var, GPBType::INT64);
  255. $this->repeated_int64 = $var;
  256. }
  257. public function getRepeatedUint32()
  258. {
  259. return $this->repeated_uint32;
  260. }
  261. public function setRepeatedUint32(&$var)
  262. {
  263. GPBUtil::checkRepeatedField($var, GPBType::UINT32);
  264. $this->repeated_uint32 = $var;
  265. }
  266. public function getRepeatedUint64()
  267. {
  268. return $this->repeated_uint64;
  269. }
  270. public function setRepeatedUint64(&$var)
  271. {
  272. GPBUtil::checkRepeatedField($var, GPBType::UINT64);
  273. $this->repeated_uint64 = $var;
  274. }
  275. public function getRepeatedSint32()
  276. {
  277. return $this->repeated_sint32;
  278. }
  279. public function setRepeatedSint32(&$var)
  280. {
  281. GPBUtil::checkRepeatedField($var, GPBType::SINT32);
  282. $this->repeated_sint32 = $var;
  283. }
  284. public function getRepeatedSint64()
  285. {
  286. return $this->repeated_sint64;
  287. }
  288. public function setRepeatedSint64(&$var)
  289. {
  290. GPBUtil::checkRepeatedField($var, GPBType::SINT64);
  291. $this->repeated_sint64 = $var;
  292. }
  293. public function getRepeatedFixed32()
  294. {
  295. return $this->repeated_fixed32;
  296. }
  297. public function setRepeatedFixed32(&$var)
  298. {
  299. GPBUtil::checkRepeatedField($var, GPBType::FIXED32);
  300. $this->repeated_fixed32 = $var;
  301. }
  302. public function getRepeatedFixed64()
  303. {
  304. return $this->repeated_fixed64;
  305. }
  306. public function setRepeatedFixed64(&$var)
  307. {
  308. GPBUtil::checkRepeatedField($var, GPBType::FIXED64);
  309. $this->repeated_fixed64 = $var;
  310. }
  311. public function getRepeatedSfixed32()
  312. {
  313. return $this->repeated_sfixed32;
  314. }
  315. public function setRepeatedSfixed32(&$var)
  316. {
  317. GPBUtil::checkRepeatedField($var, GPBType::SFIXED32);
  318. $this->repeated_sfixed32 = $var;
  319. }
  320. public function getRepeatedSfixed64()
  321. {
  322. return $this->repeated_sfixed64;
  323. }
  324. public function setRepeatedSfixed64(&$var)
  325. {
  326. GPBUtil::checkRepeatedField($var, GPBType::SFIXED64);
  327. $this->repeated_sfixed64 = $var;
  328. }
  329. public function getRepeatedFloat()
  330. {
  331. return $this->repeated_float;
  332. }
  333. public function setRepeatedFloat(&$var)
  334. {
  335. GPBUtil::checkRepeatedField($var, GPBType::FLOAT);
  336. $this->repeated_float = $var;
  337. }
  338. public function getRepeatedDouble()
  339. {
  340. return $this->repeated_double;
  341. }
  342. public function setRepeatedDouble(&$var)
  343. {
  344. GPBUtil::checkRepeatedField($var, GPBType::DOUBLE);
  345. $this->repeated_double = $var;
  346. }
  347. public function getRepeatedBool()
  348. {
  349. return $this->repeated_bool;
  350. }
  351. public function setRepeatedBool(&$var)
  352. {
  353. GPBUtil::checkRepeatedField($var, GPBType::BOOL);
  354. $this->repeated_bool = $var;
  355. }
  356. public function getRepeatedString()
  357. {
  358. return $this->repeated_string;
  359. }
  360. public function setRepeatedString(&$var)
  361. {
  362. GPBUtil::checkRepeatedField($var, GPBType::STRING);
  363. $this->repeated_string = $var;
  364. }
  365. public function getRepeatedBytes()
  366. {
  367. return $this->repeated_bytes;
  368. }
  369. public function setRepeatedBytes(&$var)
  370. {
  371. GPBUtil::checkRepeatedField($var, GPBType::BYTES);
  372. $this->repeated_bytes = $var;
  373. }
  374. public function getRepeatedEnum()
  375. {
  376. return $this->repeated_enum;
  377. }
  378. public function setRepeatedEnum(&$var)
  379. {
  380. GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class);
  381. $this->repeated_enum = $var;
  382. }
  383. public function getRepeatedMessage()
  384. {
  385. return $this->repeated_message;
  386. }
  387. public function setRepeatedMessage(&$var)
  388. {
  389. GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Foo\TestMessage_Sub::class);
  390. $this->repeated_message = $var;
  391. }
  392. public function getRepeatedRecursive()
  393. {
  394. return $this->repeated_recursive;
  395. }
  396. public function setRepeatedRecursive(&$var)
  397. {
  398. GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Foo\TestMessage::class);
  399. $this->repeated_recursive = $var;
  400. }
  401. public function getOneofInt32()
  402. {
  403. return $this->readOneof(51);
  404. }
  405. public function setOneofInt32($var)
  406. {
  407. GPBUtil::checkInt32($var);
  408. $this->writeOneof(51, $var);
  409. }
  410. public function getOneofInt64()
  411. {
  412. return $this->readOneof(52);
  413. }
  414. public function setOneofInt64($var)
  415. {
  416. GPBUtil::checkInt64($var);
  417. $this->writeOneof(52, $var);
  418. }
  419. public function getOneofUint32()
  420. {
  421. return $this->readOneof(53);
  422. }
  423. public function setOneofUint32($var)
  424. {
  425. GPBUtil::checkUint32($var);
  426. $this->writeOneof(53, $var);
  427. }
  428. public function getOneofUint64()
  429. {
  430. return $this->readOneof(54);
  431. }
  432. public function setOneofUint64($var)
  433. {
  434. GPBUtil::checkUint64($var);
  435. $this->writeOneof(54, $var);
  436. }
  437. public function getOneofSint32()
  438. {
  439. return $this->readOneof(55);
  440. }
  441. public function setOneofSint32($var)
  442. {
  443. GPBUtil::checkUint32($var);
  444. $this->writeOneof(55, $var);
  445. }
  446. public function getOneofSint64()
  447. {
  448. return $this->readOneof(56);
  449. }
  450. public function setOneofSint64($var)
  451. {
  452. GPBUtil::checkUint64($var);
  453. $this->writeOneof(56, $var);
  454. }
  455. public function getOneofFixed32()
  456. {
  457. return $this->readOneof(57);
  458. }
  459. public function setOneofFixed32($var)
  460. {
  461. GPBUtil::checkUint32($var);
  462. $this->writeOneof(57, $var);
  463. }
  464. public function getOneofFixed64()
  465. {
  466. return $this->readOneof(58);
  467. }
  468. public function setOneofFixed64($var)
  469. {
  470. GPBUtil::checkUint64($var);
  471. $this->writeOneof(58, $var);
  472. }
  473. public function getOneofSfixed32()
  474. {
  475. return $this->readOneof(59);
  476. }
  477. public function setOneofSfixed32($var)
  478. {
  479. GPBUtil::checkUint32($var);
  480. $this->writeOneof(59, $var);
  481. }
  482. public function getOneofSfixed64()
  483. {
  484. return $this->readOneof(60);
  485. }
  486. public function setOneofSfixed64($var)
  487. {
  488. GPBUtil::checkUint64($var);
  489. $this->writeOneof(60, $var);
  490. }
  491. public function getOneofDouble()
  492. {
  493. return $this->readOneof(61);
  494. }
  495. public function setOneofDouble($var)
  496. {
  497. GPBUtil::checkDouble($var);
  498. $this->writeOneof(61, $var);
  499. }
  500. public function getOneofFloat()
  501. {
  502. return $this->readOneof(62);
  503. }
  504. public function setOneofFloat($var)
  505. {
  506. GPBUtil::checkFloat($var);
  507. $this->writeOneof(62, $var);
  508. }
  509. public function getOneofBool()
  510. {
  511. return $this->readOneof(63);
  512. }
  513. public function setOneofBool($var)
  514. {
  515. GPBUtil::checkBool($var);
  516. $this->writeOneof(63, $var);
  517. }
  518. public function getOneofString()
  519. {
  520. return $this->readOneof(64);
  521. }
  522. public function setOneofString($var)
  523. {
  524. GPBUtil::checkString($var, True);
  525. $this->writeOneof(64, $var);
  526. }
  527. public function getOneofBytes()
  528. {
  529. return $this->readOneof(65);
  530. }
  531. public function setOneofBytes($var)
  532. {
  533. GPBUtil::checkString($var, False);
  534. $this->writeOneof(65, $var);
  535. }
  536. public function getOneofEnum()
  537. {
  538. return $this->readOneof(66);
  539. }
  540. public function setOneofEnum($var)
  541. {
  542. GPBUtil::checkEnum($var, \Foo\TestEnum::class);
  543. $this->writeOneof(66, $var);
  544. }
  545. public function getOneofMessage()
  546. {
  547. return $this->readOneof(67);
  548. }
  549. public function setOneofMessage(&$var)
  550. {
  551. GPBUtil::checkMessage($var, \Foo\TestMessage_Sub::class);
  552. $this->writeOneof(67, $var);
  553. }
  554. public function getMapInt32Int32()
  555. {
  556. return $this->map_int32_int32;
  557. }
  558. public function setMapInt32Int32(&$var)
  559. {
  560. $this->map_int32_int32 = $var;
  561. }
  562. public function getMapInt64Int64()
  563. {
  564. return $this->map_int64_int64;
  565. }
  566. public function setMapInt64Int64(&$var)
  567. {
  568. $this->map_int64_int64 = $var;
  569. }
  570. public function getMapUint32Uint32()
  571. {
  572. return $this->map_uint32_uint32;
  573. }
  574. public function setMapUint32Uint32(&$var)
  575. {
  576. $this->map_uint32_uint32 = $var;
  577. }
  578. public function getMapUint64Uint64()
  579. {
  580. return $this->map_uint64_uint64;
  581. }
  582. public function setMapUint64Uint64(&$var)
  583. {
  584. $this->map_uint64_uint64 = $var;
  585. }
  586. public function getMapSint32Sint32()
  587. {
  588. return $this->map_sint32_sint32;
  589. }
  590. public function setMapSint32Sint32(&$var)
  591. {
  592. $this->map_sint32_sint32 = $var;
  593. }
  594. public function getMapSint64Sint64()
  595. {
  596. return $this->map_sint64_sint64;
  597. }
  598. public function setMapSint64Sint64(&$var)
  599. {
  600. $this->map_sint64_sint64 = $var;
  601. }
  602. public function getMapFixed32Fixed32()
  603. {
  604. return $this->map_fixed32_fixed32;
  605. }
  606. public function setMapFixed32Fixed32(&$var)
  607. {
  608. $this->map_fixed32_fixed32 = $var;
  609. }
  610. public function getMapFixed64Fixed64()
  611. {
  612. return $this->map_fixed64_fixed64;
  613. }
  614. public function setMapFixed64Fixed64(&$var)
  615. {
  616. $this->map_fixed64_fixed64 = $var;
  617. }
  618. public function getMapSfixed32Sfixed32()
  619. {
  620. return $this->map_sfixed32_sfixed32;
  621. }
  622. public function setMapSfixed32Sfixed32(&$var)
  623. {
  624. $this->map_sfixed32_sfixed32 = $var;
  625. }
  626. public function getMapSfixed64Sfixed64()
  627. {
  628. return $this->map_sfixed64_sfixed64;
  629. }
  630. public function setMapSfixed64Sfixed64(&$var)
  631. {
  632. $this->map_sfixed64_sfixed64 = $var;
  633. }
  634. public function getMapInt32Float()
  635. {
  636. return $this->map_int32_float;
  637. }
  638. public function setMapInt32Float(&$var)
  639. {
  640. $this->map_int32_float = $var;
  641. }
  642. public function getMapInt32Double()
  643. {
  644. return $this->map_int32_double;
  645. }
  646. public function setMapInt32Double(&$var)
  647. {
  648. $this->map_int32_double = $var;
  649. }
  650. public function getMapBoolBool()
  651. {
  652. return $this->map_bool_bool;
  653. }
  654. public function setMapBoolBool(&$var)
  655. {
  656. $this->map_bool_bool = $var;
  657. }
  658. public function getMapStringString()
  659. {
  660. return $this->map_string_string;
  661. }
  662. public function setMapStringString(&$var)
  663. {
  664. $this->map_string_string = $var;
  665. }
  666. public function getMapInt32Bytes()
  667. {
  668. return $this->map_int32_bytes;
  669. }
  670. public function setMapInt32Bytes(&$var)
  671. {
  672. $this->map_int32_bytes = $var;
  673. }
  674. public function getMapInt32Enum()
  675. {
  676. return $this->map_int32_enum;
  677. }
  678. public function setMapInt32Enum(&$var)
  679. {
  680. $this->map_int32_enum = $var;
  681. }
  682. public function getMapInt32Message()
  683. {
  684. return $this->map_int32_message;
  685. }
  686. public function setMapInt32Message(&$var)
  687. {
  688. $this->map_int32_message = $var;
  689. }
  690. public function getMapRecursive()
  691. {
  692. return $this->map_recursive;
  693. }
  694. public function setMapRecursive(&$var)
  695. {
  696. $this->map_recursive = $var;
  697. }
  698. public function getMyOneof()
  699. {
  700. return $this->my_oneof;
  701. }
  702. }
  703. class TestMessage_Sub extends \Google\Protobuf\Internal\Message
  704. {
  705. private $a = 0;
  706. public function getA()
  707. {
  708. return $this->a;
  709. }
  710. public function setA($var)
  711. {
  712. GPBUtil::checkInt32($var);
  713. $this->a = $var;
  714. }
  715. }
  716. class TestPackedMessage extends \Google\Protobuf\Internal\Message
  717. {
  718. private $repeated_int32;
  719. private $repeated_int64;
  720. private $repeated_uint32;
  721. private $repeated_uint64;
  722. private $repeated_sint32;
  723. private $repeated_sint64;
  724. private $repeated_fixed32;
  725. private $repeated_fixed64;
  726. private $repeated_sfixed32;
  727. private $repeated_sfixed64;
  728. private $repeated_float;
  729. private $repeated_double;
  730. private $repeated_bool;
  731. private $repeated_enum;
  732. public function getRepeatedInt32()
  733. {
  734. return $this->repeated_int32;
  735. }
  736. public function setRepeatedInt32(&$var)
  737. {
  738. GPBUtil::checkRepeatedField($var, GPBType::INT32);
  739. $this->repeated_int32 = $var;
  740. }
  741. public function getRepeatedInt64()
  742. {
  743. return $this->repeated_int64;
  744. }
  745. public function setRepeatedInt64(&$var)
  746. {
  747. GPBUtil::checkRepeatedField($var, GPBType::INT64);
  748. $this->repeated_int64 = $var;
  749. }
  750. public function getRepeatedUint32()
  751. {
  752. return $this->repeated_uint32;
  753. }
  754. public function setRepeatedUint32(&$var)
  755. {
  756. GPBUtil::checkRepeatedField($var, GPBType::UINT32);
  757. $this->repeated_uint32 = $var;
  758. }
  759. public function getRepeatedUint64()
  760. {
  761. return $this->repeated_uint64;
  762. }
  763. public function setRepeatedUint64(&$var)
  764. {
  765. GPBUtil::checkRepeatedField($var, GPBType::UINT64);
  766. $this->repeated_uint64 = $var;
  767. }
  768. public function getRepeatedSint32()
  769. {
  770. return $this->repeated_sint32;
  771. }
  772. public function setRepeatedSint32(&$var)
  773. {
  774. GPBUtil::checkRepeatedField($var, GPBType::SINT32);
  775. $this->repeated_sint32 = $var;
  776. }
  777. public function getRepeatedSint64()
  778. {
  779. return $this->repeated_sint64;
  780. }
  781. public function setRepeatedSint64(&$var)
  782. {
  783. GPBUtil::checkRepeatedField($var, GPBType::SINT64);
  784. $this->repeated_sint64 = $var;
  785. }
  786. public function getRepeatedFixed32()
  787. {
  788. return $this->repeated_fixed32;
  789. }
  790. public function setRepeatedFixed32(&$var)
  791. {
  792. GPBUtil::checkRepeatedField($var, GPBType::FIXED32);
  793. $this->repeated_fixed32 = $var;
  794. }
  795. public function getRepeatedFixed64()
  796. {
  797. return $this->repeated_fixed64;
  798. }
  799. public function setRepeatedFixed64(&$var)
  800. {
  801. GPBUtil::checkRepeatedField($var, GPBType::FIXED64);
  802. $this->repeated_fixed64 = $var;
  803. }
  804. public function getRepeatedSfixed32()
  805. {
  806. return $this->repeated_sfixed32;
  807. }
  808. public function setRepeatedSfixed32(&$var)
  809. {
  810. GPBUtil::checkRepeatedField($var, GPBType::SFIXED32);
  811. $this->repeated_sfixed32 = $var;
  812. }
  813. public function getRepeatedSfixed64()
  814. {
  815. return $this->repeated_sfixed64;
  816. }
  817. public function setRepeatedSfixed64(&$var)
  818. {
  819. GPBUtil::checkRepeatedField($var, GPBType::SFIXED64);
  820. $this->repeated_sfixed64 = $var;
  821. }
  822. public function getRepeatedFloat()
  823. {
  824. return $this->repeated_float;
  825. }
  826. public function setRepeatedFloat(&$var)
  827. {
  828. GPBUtil::checkRepeatedField($var, GPBType::FLOAT);
  829. $this->repeated_float = $var;
  830. }
  831. public function getRepeatedDouble()
  832. {
  833. return $this->repeated_double;
  834. }
  835. public function setRepeatedDouble(&$var)
  836. {
  837. GPBUtil::checkRepeatedField($var, GPBType::DOUBLE);
  838. $this->repeated_double = $var;
  839. }
  840. public function getRepeatedBool()
  841. {
  842. return $this->repeated_bool;
  843. }
  844. public function setRepeatedBool(&$var)
  845. {
  846. GPBUtil::checkRepeatedField($var, GPBType::BOOL);
  847. $this->repeated_bool = $var;
  848. }
  849. public function getRepeatedEnum()
  850. {
  851. return $this->repeated_enum;
  852. }
  853. public function setRepeatedEnum(&$var)
  854. {
  855. GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class);
  856. $this->repeated_enum = $var;
  857. }
  858. }
  859. class TestUnpackedMessage extends \Google\Protobuf\Internal\Message
  860. {
  861. private $repeated_int32;
  862. private $repeated_int64;
  863. private $repeated_uint32;
  864. private $repeated_uint64;
  865. private $repeated_sint32;
  866. private $repeated_sint64;
  867. private $repeated_fixed32;
  868. private $repeated_fixed64;
  869. private $repeated_sfixed32;
  870. private $repeated_sfixed64;
  871. private $repeated_float;
  872. private $repeated_double;
  873. private $repeated_bool;
  874. private $repeated_enum;
  875. public function getRepeatedInt32()
  876. {
  877. return $this->repeated_int32;
  878. }
  879. public function setRepeatedInt32(&$var)
  880. {
  881. GPBUtil::checkRepeatedField($var, GPBType::INT32);
  882. $this->repeated_int32 = $var;
  883. }
  884. public function getRepeatedInt64()
  885. {
  886. return $this->repeated_int64;
  887. }
  888. public function setRepeatedInt64(&$var)
  889. {
  890. GPBUtil::checkRepeatedField($var, GPBType::INT64);
  891. $this->repeated_int64 = $var;
  892. }
  893. public function getRepeatedUint32()
  894. {
  895. return $this->repeated_uint32;
  896. }
  897. public function setRepeatedUint32(&$var)
  898. {
  899. GPBUtil::checkRepeatedField($var, GPBType::UINT32);
  900. $this->repeated_uint32 = $var;
  901. }
  902. public function getRepeatedUint64()
  903. {
  904. return $this->repeated_uint64;
  905. }
  906. public function setRepeatedUint64(&$var)
  907. {
  908. GPBUtil::checkRepeatedField($var, GPBType::UINT64);
  909. $this->repeated_uint64 = $var;
  910. }
  911. public function getRepeatedSint32()
  912. {
  913. return $this->repeated_sint32;
  914. }
  915. public function setRepeatedSint32(&$var)
  916. {
  917. GPBUtil::checkRepeatedField($var, GPBType::SINT32);
  918. $this->repeated_sint32 = $var;
  919. }
  920. public function getRepeatedSint64()
  921. {
  922. return $this->repeated_sint64;
  923. }
  924. public function setRepeatedSint64(&$var)
  925. {
  926. GPBUtil::checkRepeatedField($var, GPBType::SINT64);
  927. $this->repeated_sint64 = $var;
  928. }
  929. public function getRepeatedFixed32()
  930. {
  931. return $this->repeated_fixed32;
  932. }
  933. public function setRepeatedFixed32(&$var)
  934. {
  935. GPBUtil::checkRepeatedField($var, GPBType::FIXED32);
  936. $this->repeated_fixed32 = $var;
  937. }
  938. public function getRepeatedFixed64()
  939. {
  940. return $this->repeated_fixed64;
  941. }
  942. public function setRepeatedFixed64(&$var)
  943. {
  944. GPBUtil::checkRepeatedField($var, GPBType::FIXED64);
  945. $this->repeated_fixed64 = $var;
  946. }
  947. public function getRepeatedSfixed32()
  948. {
  949. return $this->repeated_sfixed32;
  950. }
  951. public function setRepeatedSfixed32(&$var)
  952. {
  953. GPBUtil::checkRepeatedField($var, GPBType::SFIXED32);
  954. $this->repeated_sfixed32 = $var;
  955. }
  956. public function getRepeatedSfixed64()
  957. {
  958. return $this->repeated_sfixed64;
  959. }
  960. public function setRepeatedSfixed64(&$var)
  961. {
  962. GPBUtil::checkRepeatedField($var, GPBType::SFIXED64);
  963. $this->repeated_sfixed64 = $var;
  964. }
  965. public function getRepeatedFloat()
  966. {
  967. return $this->repeated_float;
  968. }
  969. public function setRepeatedFloat(&$var)
  970. {
  971. GPBUtil::checkRepeatedField($var, GPBType::FLOAT);
  972. $this->repeated_float = $var;
  973. }
  974. public function getRepeatedDouble()
  975. {
  976. return $this->repeated_double;
  977. }
  978. public function setRepeatedDouble(&$var)
  979. {
  980. GPBUtil::checkRepeatedField($var, GPBType::DOUBLE);
  981. $this->repeated_double = $var;
  982. }
  983. public function getRepeatedBool()
  984. {
  985. return $this->repeated_bool;
  986. }
  987. public function setRepeatedBool(&$var)
  988. {
  989. GPBUtil::checkRepeatedField($var, GPBType::BOOL);
  990. $this->repeated_bool = $var;
  991. }
  992. public function getRepeatedEnum()
  993. {
  994. return $this->repeated_enum;
  995. }
  996. public function setRepeatedEnum(&$var)
  997. {
  998. GPBUtil::checkRepeatedField($var, GPBType::ENUM, Foo\TestEnum::class);
  999. $this->repeated_enum = $var;
  1000. }
  1001. }
  1002. class TestEnum
  1003. {
  1004. const ZERO = 0;
  1005. const ONE = 1;
  1006. }
  1007. $pool = DescriptorPool::getGeneratedPool();
  1008. $pool->internalAddGeneratedFile(hex2bin(
  1009. "0a83250a0a746573742e70726f746f1203666f6f1a12746573745f696e63" .
  1010. "6c7564652e70726f746f22be1d0a0b546573744d65737361676512160a0e" .
  1011. "6f7074696f6e616c5f696e74333218012001280512160a0e6f7074696f6e" .
  1012. "616c5f696e74363418022001280312170a0f6f7074696f6e616c5f75696e" .
  1013. "74333218032001280d12170a0f6f7074696f6e616c5f75696e7436341804" .
  1014. "2001280412170a0f6f7074696f6e616c5f73696e74333218052001281112" .
  1015. "170a0f6f7074696f6e616c5f73696e74363418062001281212180a106f70" .
  1016. "74696f6e616c5f6669786564333218072001280712180a106f7074696f6e" .
  1017. "616c5f6669786564363418082001280612190a116f7074696f6e616c5f73" .
  1018. "6669786564333218092001280f12190a116f7074696f6e616c5f73666978" .
  1019. "65643634180a2001281012160a0e6f7074696f6e616c5f666c6f6174180b" .
  1020. "2001280212170a0f6f7074696f6e616c5f646f75626c65180c2001280112" .
  1021. "150a0d6f7074696f6e616c5f626f6f6c180d2001280812170a0f6f707469" .
  1022. "6f6e616c5f737472696e67180e2001280912160a0e6f7074696f6e616c5f" .
  1023. "6279746573180f2001280c12240a0d6f7074696f6e616c5f656e756d1810" .
  1024. "2001280e320d2e666f6f2e54657374456e756d122e0a106f7074696f6e61" .
  1025. "6c5f6d65737361676518112001280b32142e666f6f2e546573744d657373" .
  1026. "6167652e53756212330a196f7074696f6e616c5f696e636c756465645f6d" .
  1027. "65737361676518122001280b32102e6261722e54657374496e636c756465" .
  1028. "12230a0972656375727369766518132001280b32102e666f6f2e54657374" .
  1029. "4d65737361676512160a0e72657065617465645f696e743332181f200328" .
  1030. "0512160a0e72657065617465645f696e74363418202003280312170a0f72" .
  1031. "657065617465645f75696e74333218212003280d12170a0f726570656174" .
  1032. "65645f75696e74363418222003280412170a0f72657065617465645f7369" .
  1033. "6e74333218232003281112170a0f72657065617465645f73696e74363418" .
  1034. "242003281212180a1072657065617465645f666978656433321825200328" .
  1035. "0712180a1072657065617465645f6669786564363418262003280612190a" .
  1036. "1172657065617465645f736669786564333218272003280f12190a117265" .
  1037. "7065617465645f736669786564363418282003281012160a0e7265706561" .
  1038. "7465645f666c6f617418292003280212170a0f72657065617465645f646f" .
  1039. "75626c65182a2003280112150a0d72657065617465645f626f6f6c182b20" .
  1040. "03280812170a0f72657065617465645f737472696e67182c200328091216" .
  1041. "0a0e72657065617465645f6279746573182d2003280c12240a0d72657065" .
  1042. "617465645f656e756d182e2003280e320d2e666f6f2e54657374456e756d" .
  1043. "122e0a1072657065617465645f6d657373616765182f2003280b32142e66" .
  1044. "6f6f2e546573744d6573736167652e537562122c0a127265706561746564" .
  1045. "5f72656375727369766518302003280b32102e666f6f2e546573744d6573" .
  1046. "7361676512150a0b6f6e656f665f696e743332183320012805480012150a" .
  1047. "0b6f6e656f665f696e743634183420012803480012160a0c6f6e656f665f" .
  1048. "75696e74333218352001280d480012160a0c6f6e656f665f75696e743634" .
  1049. "183620012804480012160a0c6f6e656f665f73696e74333218372001280d" .
  1050. "480012160a0c6f6e656f665f73696e743634183820012804480012170a0d" .
  1051. "6f6e656f665f6669786564333218392001280d480012170a0d6f6e656f66" .
  1052. "5f66697865643634183a20012804480012180a0e6f6e656f665f73666978" .
  1053. "65643332183b2001280d480012180a0e6f6e656f665f7366697865643634" .
  1054. "183c20012804480012160a0c6f6e656f665f646f75626c65183d20012801" .
  1055. "480012150a0b6f6e656f665f666c6f6174183e20012802480012140a0a6f" .
  1056. "6e656f665f626f6f6c183f20012808480012160a0c6f6e656f665f737472" .
  1057. "696e67184020012809480012150a0b6f6e656f665f627974657318412001" .
  1058. "280c480012230a0a6f6e656f665f656e756d18422001280e320d2e666f6f" .
  1059. "2e54657374456e756d4800122d0a0d6f6e656f665f6d6573736167651843" .
  1060. "2001280b32142e666f6f2e546573744d6573736167652e5375624800123c" .
  1061. "0a0f6d61705f696e7433325f696e74333218472003280b32232e666f6f2e" .
  1062. "546573744d6573736167652e4d6170496e743332496e743332456e747279" .
  1063. "123c0a0f6d61705f696e7436345f696e74363418482003280b32232e666f" .
  1064. "6f2e546573744d6573736167652e4d6170496e743634496e743634456e74" .
  1065. "727912400a116d61705f75696e7433325f75696e74333218492003280b32" .
  1066. "252e666f6f2e546573744d6573736167652e4d617055696e74333255696e" .
  1067. "743332456e74727912400a116d61705f75696e7436345f75696e74363418" .
  1068. "4a2003280b32252e666f6f2e546573744d6573736167652e4d617055696e" .
  1069. "74363455696e743634456e74727912400a116d61705f73696e7433325f73" .
  1070. "696e743332184b2003280b32252e666f6f2e546573744d6573736167652e" .
  1071. "4d617053696e74333253696e743332456e74727912400a116d61705f7369" .
  1072. "6e7436345f73696e743634184c2003280b32252e666f6f2e546573744d65" .
  1073. "73736167652e4d617053696e74363453696e743634456e74727912440a13" .
  1074. "6d61705f666978656433325f66697865643332184d2003280b32272e666f" .
  1075. "6f2e546573744d6573736167652e4d617046697865643332466978656433" .
  1076. "32456e74727912440a136d61705f666978656436345f6669786564363418" .
  1077. "4e2003280b32272e666f6f2e546573744d6573736167652e4d6170466978" .
  1078. "6564363446697865643634456e74727912480a156d61705f736669786564" .
  1079. "33325f7366697865643332184f2003280b32292e666f6f2e546573744d65" .
  1080. "73736167652e4d617053666978656433325366697865643332456e747279" .
  1081. "12480a156d61705f73666978656436345f73666978656436341850200328" .
  1082. "0b32292e666f6f2e546573744d6573736167652e4d617053666978656436" .
  1083. "345366697865643634456e747279123c0a0f6d61705f696e7433325f666c" .
  1084. "6f617418512003280b32232e666f6f2e546573744d6573736167652e4d61" .
  1085. "70496e743332466c6f6174456e747279123e0a106d61705f696e7433325f" .
  1086. "646f75626c6518522003280b32242e666f6f2e546573744d657373616765" .
  1087. "2e4d6170496e743332446f75626c65456e74727912380a0d6d61705f626f" .
  1088. "6f6c5f626f6f6c18532003280b32212e666f6f2e546573744d6573736167" .
  1089. "652e4d6170426f6f6c426f6f6c456e74727912400a116d61705f73747269" .
  1090. "6e675f737472696e6718542003280b32252e666f6f2e546573744d657373" .
  1091. "6167652e4d6170537472696e67537472696e67456e747279123c0a0f6d61" .
  1092. "705f696e7433325f627974657318552003280b32232e666f6f2e54657374" .
  1093. "4d6573736167652e4d6170496e7433324279746573456e747279123a0a0e" .
  1094. "6d61705f696e7433325f656e756d18562003280b32222e666f6f2e546573" .
  1095. "744d6573736167652e4d6170496e743332456e756d456e74727912400a11" .
  1096. "6d61705f696e7433325f6d65737361676518572003280b32252e666f6f2e" .
  1097. "546573744d6573736167652e4d6170496e7433324d657373616765456e74" .
  1098. "727912390a0d6d61705f72656375727369766518582003280b32222e666f" .
  1099. "6f2e546573744d6573736167652e4d6170526563757273697665456e7472" .
  1100. "791a340a124d6170496e743332496e743332456e747279120b0a036b6579" .
  1101. "180120012805120d0a0576616c75651802200128053a0238011a340a124d" .
  1102. "6170496e743634496e743634456e747279120b0a036b6579180120012803" .
  1103. "120d0a0576616c75651802200128033a0238011a360a144d617055696e74" .
  1104. "333255696e743332456e747279120b0a036b657918012001280d120d0a05" .
  1105. "76616c756518022001280d3a0238011a360a144d617055696e7436345569" .
  1106. "6e743634456e747279120b0a036b6579180120012804120d0a0576616c75" .
  1107. "651802200128043a0238011a360a144d617053696e74333253696e743332" .
  1108. "456e747279120b0a036b6579180120012811120d0a0576616c7565180220" .
  1109. "0128113a0238011a360a144d617053696e74363453696e743634456e7472" .
  1110. "79120b0a036b6579180120012812120d0a0576616c75651802200128123a" .
  1111. "0238011a380a164d61704669786564333246697865643332456e74727912" .
  1112. "0b0a036b6579180120012807120d0a0576616c75651802200128073a0238" .
  1113. "011a380a164d61704669786564363446697865643634456e747279120b0a" .
  1114. "036b6579180120012806120d0a0576616c75651802200128063a0238011a" .
  1115. "3a0a184d617053666978656433325366697865643332456e747279120b0a" .
  1116. "036b657918012001280f120d0a0576616c756518022001280f3a0238011a" .
  1117. "3a0a184d617053666978656436345366697865643634456e747279120b0a" .
  1118. "036b6579180120012810120d0a0576616c75651802200128103a0238011a" .
  1119. "340a124d6170496e743332466c6f6174456e747279120b0a036b65791801" .
  1120. "20012805120d0a0576616c75651802200128023a0238011a350a134d6170" .
  1121. "496e743332446f75626c65456e747279120b0a036b657918012001280512" .
  1122. "0d0a0576616c75651802200128013a0238011a320a104d6170426f6f6c42" .
  1123. "6f6f6c456e747279120b0a036b6579180120012808120d0a0576616c7565" .
  1124. "1802200128083a0238011a360a144d6170537472696e67537472696e6745" .
  1125. "6e747279120b0a036b6579180120012809120d0a0576616c756518022001" .
  1126. "28093a0238011a340a124d6170496e7433324279746573456e747279120b" .
  1127. "0a036b6579180120012805120d0a0576616c756518022001280c3a023801" .
  1128. "1a420a114d6170496e743332456e756d456e747279120b0a036b65791801" .
  1129. "20012805121c0a0576616c756518022001280e320d2e666f6f2e54657374" .
  1130. "456e756d3a0238011a4c0a144d6170496e7433324d657373616765456e74" .
  1131. "7279120b0a036b657918012001280512230a0576616c756518022001280b" .
  1132. "32142e666f6f2e546573744d6573736167652e5375623a0238011a450a11" .
  1133. "4d6170526563757273697665456e747279120b0a036b6579180120012805" .
  1134. "121f0a0576616c756518022001280b32102e666f6f2e546573744d657373" .
  1135. "6167653a0238011a100a0353756212090a0161180120012805420a0a086d" .
  1136. "795f6f6e656f6622b7030a11546573745061636b65644d65737361676512" .
  1137. "1a0a0e72657065617465645f696e743332185a2003280542021001121a0a" .
  1138. "0e72657065617465645f696e743634185b2003280342021001121b0a0f72" .
  1139. "657065617465645f75696e743332185c2003280d42021001121b0a0f7265" .
  1140. "7065617465645f75696e743634185d2003280442021001121b0a0f726570" .
  1141. "65617465645f73696e743332185e2003281142021001121b0a0f72657065" .
  1142. "617465645f73696e743634185f2003281242021001121c0a107265706561" .
  1143. "7465645f6669786564333218602003280742021001121c0a107265706561" .
  1144. "7465645f6669786564363418612003280642021001121d0a117265706561" .
  1145. "7465645f736669786564333218622003280f42021001121d0a1172657065" .
  1146. "617465645f736669786564363418632003281042021001121a0a0e726570" .
  1147. "65617465645f666c6f617418642003280242021001121b0a0f7265706561" .
  1148. "7465645f646f75626c651865200328014202100112190a0d726570656174" .
  1149. "65645f626f6f6c1866200328084202100112280a0d72657065617465645f" .
  1150. "656e756d18672003280e320d2e666f6f2e54657374456e756d4202100122" .
  1151. "b9030a1354657374556e7061636b65644d657373616765121a0a0e726570" .
  1152. "65617465645f696e743332185a2003280542021000121a0a0e7265706561" .
  1153. "7465645f696e743634185b2003280342021000121b0a0f72657065617465" .
  1154. "645f75696e743332185c2003280d42021000121b0a0f7265706561746564" .
  1155. "5f75696e743634185d2003280442021000121b0a0f72657065617465645f" .
  1156. "73696e743332185e2003281142021000121b0a0f72657065617465645f73" .
  1157. "696e743634185f2003281242021000121c0a1072657065617465645f6669" .
  1158. "786564333218602003280742021000121c0a1072657065617465645f6669" .
  1159. "786564363418612003280642021000121d0a1172657065617465645f7366" .
  1160. "69786564333218622003280f42021000121d0a1172657065617465645f73" .
  1161. "6669786564363418632003281042021000121a0a0e72657065617465645f" .
  1162. "666c6f617418642003280242021000121b0a0f72657065617465645f646f" .
  1163. "75626c651865200328014202100012190a0d72657065617465645f626f6f" .
  1164. "6c1866200328084202100012280a0d72657065617465645f656e756d1867" .
  1165. "2003280e320d2e666f6f2e54657374456e756d420210002a1d0a08546573" .
  1166. "74456e756d12080a045a45524f100012070a034f4e451001620670726f74" .
  1167. "6f33"
  1168. ));