1<?php 2// automatically generated by the FlatBuffers compiler, do not modify 3 4namespace NamespaceC; 5 6use \Google\FlatBuffers\Struct; 7use \Google\FlatBuffers\Table; 8use \Google\FlatBuffers\ByteBuffer; 9use \Google\FlatBuffers\FlatBufferBuilder; 10 11class TableInC extends Table 12{ 13 /** 14 * @param ByteBuffer $bb 15 * @return TableInC 16 */ 17 public static function getRootAsTableInC(ByteBuffer $bb) 18 { 19 $obj = new TableInC(); 20 return ($obj->init($bb->getInt($bb->getPosition()) + $bb->getPosition(), $bb)); 21 } 22 23 /** 24 * @param int $_i offset 25 * @param ByteBuffer $_bb 26 * @return TableInC 27 **/ 28 public function init($_i, ByteBuffer $_bb) 29 { 30 $this->bb_pos = $_i; 31 $this->bb = $_bb; 32 return $this; 33 } 34 35 public function getReferToA1() 36 { 37 $obj = new TableInFirstNS(); 38 $o = $this->__offset(4); 39 return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0; 40 } 41 42 public function getReferToA2() 43 { 44 $obj = new SecondTableInA(); 45 $o = $this->__offset(6); 46 return $o != 0 ? $obj->init($this->__indirect($o + $this->bb_pos), $this->bb) : 0; 47 } 48 49 /** 50 * @param FlatBufferBuilder $builder 51 * @return void 52 */ 53 public static function startTableInC(FlatBufferBuilder $builder) 54 { 55 $builder->StartObject(2); 56 } 57 58 /** 59 * @param FlatBufferBuilder $builder 60 * @return TableInC 61 */ 62 public static function createTableInC(FlatBufferBuilder $builder, $refer_to_a1, $refer_to_a2) 63 { 64 $builder->startObject(2); 65 self::addReferToA1($builder, $refer_to_a1); 66 self::addReferToA2($builder, $refer_to_a2); 67 $o = $builder->endObject(); 68 return $o; 69 } 70 71 /** 72 * @param FlatBufferBuilder $builder 73 * @param int 74 * @return void 75 */ 76 public static function addReferToA1(FlatBufferBuilder $builder, $referToA1) 77 { 78 $builder->addOffsetX(0, $referToA1, 0); 79 } 80 81 /** 82 * @param FlatBufferBuilder $builder 83 * @param int 84 * @return void 85 */ 86 public static function addReferToA2(FlatBufferBuilder $builder, $referToA2) 87 { 88 $builder->addOffsetX(1, $referToA2, 0); 89 } 90 91 /** 92 * @param FlatBufferBuilder $builder 93 * @return int table offset 94 */ 95 public static function endTableInC(FlatBufferBuilder $builder) 96 { 97 $o = $builder->endObject(); 98 return $o; 99 } 100} 101