forked from drslump/Protobuf-PHP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
<?php | ||
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin @package_version@ | ||
// Source: complex.proto | ||
// Date: 2011-08-08 07:46:24 | ||
|
||
namespace tests\Complex { | ||
|
||
class Enum { | ||
const FOO = 1; | ||
const BAR = 2; | ||
const BAZ = 10; | ||
} | ||
} | ||
namespace tests\Complex { | ||
|
||
class Nested extends \DrSlump\Protobuf\Message { | ||
|
||
/** @var string */ | ||
public $foo = null; | ||
|
||
|
||
/** @var \Closure[] */ | ||
protected static $__extensions = array(); | ||
|
||
public static function descriptor() | ||
{ | ||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'tests.Complex.Nested'); | ||
|
||
// optional string foo = 1 | ||
$f = new \DrSlump\Protobuf\Field(); | ||
$f->number = 1; | ||
$f->name = "foo"; | ||
$f->type = 9; | ||
$f->rule = 1; | ||
$descriptor->addField($f); | ||
|
||
foreach (self::$__extensions as $cb) { | ||
$descriptor->addField($cb(), true); | ||
} | ||
|
||
return $descriptor; | ||
} | ||
|
||
/** | ||
* Check if <foo> has a value | ||
* | ||
* @return boolean | ||
*/ | ||
public function hasFoo(){ | ||
return $this->_has(1); | ||
} | ||
|
||
/** | ||
* Clear <foo> value | ||
* | ||
* @return \tests\Complex\Nested | ||
*/ | ||
public function clearFoo(){ | ||
return $this->_clear(1); | ||
} | ||
|
||
/** | ||
* Get <foo> value | ||
* | ||
* @return string | ||
*/ | ||
public function getFoo(){ | ||
return $this->_get(1); | ||
} | ||
|
||
/** | ||
* Set <foo> value | ||
* | ||
* @param string $value | ||
* @return \tests\Complex\Nested | ||
*/ | ||
public function setFoo( $value){ | ||
return $this->_set(1, $value); | ||
} | ||
} | ||
} | ||
|
||
namespace tests { | ||
|
||
class Complex extends \DrSlump\Protobuf\Message { | ||
|
||
/** @var int - \tests\Complex\Enum */ | ||
public $enum = null; | ||
|
||
/** @var \tests\Complex\Nested */ | ||
public $nested = null; | ||
|
||
|
||
/** @var \Closure[] */ | ||
protected static $__extensions = array(); | ||
|
||
public static function descriptor() | ||
{ | ||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'tests.Complex'); | ||
|
||
// optional .tests.Complex.Enum enum = 1 | ||
$f = new \DrSlump\Protobuf\Field(); | ||
$f->number = 1; | ||
$f->name = "enum"; | ||
$f->type = 14; | ||
$f->rule = 1; | ||
$f->reference = '\tests\Complex\Enum'; | ||
$descriptor->addField($f); | ||
|
||
// optional .tests.Complex.Nested nested = 2 | ||
$f = new \DrSlump\Protobuf\Field(); | ||
$f->number = 2; | ||
$f->name = "nested"; | ||
$f->type = 11; | ||
$f->rule = 1; | ||
$f->reference = '\tests\Complex\Nested'; | ||
$descriptor->addField($f); | ||
|
||
foreach (self::$__extensions as $cb) { | ||
$descriptor->addField($cb(), true); | ||
} | ||
|
||
return $descriptor; | ||
} | ||
|
||
/** | ||
* Check if <enum> has a value | ||
* | ||
* @return boolean | ||
*/ | ||
public function hasEnum(){ | ||
return $this->_has(1); | ||
} | ||
|
||
/** | ||
* Clear <enum> value | ||
* | ||
* @return \tests\Complex | ||
*/ | ||
public function clearEnum(){ | ||
return $this->_clear(1); | ||
} | ||
|
||
/** | ||
* Get <enum> value | ||
* | ||
* @return int - \tests\Complex\Enum | ||
*/ | ||
public function getEnum(){ | ||
return $this->_get(1); | ||
} | ||
|
||
/** | ||
* Set <enum> value | ||
* | ||
* @param int - \tests\Complex\Enum $value | ||
* @return \tests\Complex | ||
*/ | ||
public function setEnum( $value){ | ||
return $this->_set(1, $value); | ||
} | ||
|
||
/** | ||
* Check if <nested> has a value | ||
* | ||
* @return boolean | ||
*/ | ||
public function hasNested(){ | ||
return $this->_has(2); | ||
} | ||
|
||
/** | ||
* Clear <nested> value | ||
* | ||
* @return \tests\Complex | ||
*/ | ||
public function clearNested(){ | ||
return $this->_clear(2); | ||
} | ||
|
||
/** | ||
* Get <nested> value | ||
* | ||
* @return \tests\Complex\Nested | ||
*/ | ||
public function getNested(){ | ||
return $this->_get(2); | ||
} | ||
|
||
/** | ||
* Set <nested> value | ||
* | ||
* @param \tests\Complex\Nested $value | ||
* @return \tests\Complex | ||
*/ | ||
public function setNested(\tests\Complex\Nested $value){ | ||
return $this->_set(2, $value); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package tests; | ||
|
||
message Complex { | ||
|
||
enum Enum { | ||
FOO = 1; | ||
BAR = 2; | ||
BAZ = 10; | ||
} | ||
|
||
message Nested { | ||
optional string foo = 1; | ||
} | ||
|
||
optional Enum enum = 1; | ||
optional Nested nested = 2; | ||
} |