Files
flatbuffers/tests/union_vector/Rapunzel.php
Kamil Rojewski 46bb05d952 Vector of unions for TS/JS and PHP (#4404)
* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests
2017-08-11 09:24:36 -07:00

44 lines
883 B
PHP

<?php
// automatically generated by the FlatBuffers compiler, do not modify
namespace ;
use \Google\FlatBuffers\Struct;
use \Google\FlatBuffers\Table;
use \Google\FlatBuffers\ByteBuffer;
use \Google\FlatBuffers\FlatBufferBuilder;
class Rapunzel extends Struct
{
/**
* @param int $_i offset
* @param ByteBuffer $_bb
* @return Rapunzel
**/
public function init($_i, ByteBuffer $_bb)
{
$this->bb_pos = $_i;
$this->bb = $_bb;
return $this;
}
/**
* @return int
*/
public function GetHairLength()
{
return $this->bb->getInt($this->bb_pos + 0);
}
/**
* @return int offset
*/
public static function createRapunzel(FlatBufferBuilder $builder, $hairLength)
{
$builder->prep(4, 4);
$builder->putInt($hairLength);
return $builder->offset();
}
}