| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336 |
- <?php
- /*
- * Copyright (c) 2008-2016 vip.com, All Rights Reserved.
- *
- * Powered by com.vip.osp.osp-idlc-2.5.11.
- *
- */
- namespace vipapis\finance;
- class SalesOrderDetail {
-
- static $_TSPEC;
- public $order_id = null;
- public $barcode = null;
- public $amount = null;
- public $price = null;
- public $brand_name = null;
- public $product_name = null;
- public $brand_id = null;
- public $date = null;
- public $order_type = null;
-
- public function __construct($vals=null){
-
- if (!isset(self::$_TSPEC)){
-
- self::$_TSPEC = array(
- 1 => array(
- 'var' => 'order_id'
- ),
- 2 => array(
- 'var' => 'barcode'
- ),
- 3 => array(
- 'var' => 'amount'
- ),
- 4 => array(
- 'var' => 'price'
- ),
- 5 => array(
- 'var' => 'brand_name'
- ),
- 6 => array(
- 'var' => 'product_name'
- ),
- 7 => array(
- 'var' => 'brand_id'
- ),
- 8 => array(
- 'var' => 'date'
- ),
- 9 => array(
- 'var' => 'order_type'
- ),
-
- );
-
- }
-
- if (is_array($vals)){
-
-
- if (isset($vals['order_id'])){
-
- $this->order_id = $vals['order_id'];
- }
-
-
- if (isset($vals['barcode'])){
-
- $this->barcode = $vals['barcode'];
- }
-
-
- if (isset($vals['amount'])){
-
- $this->amount = $vals['amount'];
- }
-
-
- if (isset($vals['price'])){
-
- $this->price = $vals['price'];
- }
-
-
- if (isset($vals['brand_name'])){
-
- $this->brand_name = $vals['brand_name'];
- }
-
-
- if (isset($vals['product_name'])){
-
- $this->product_name = $vals['product_name'];
- }
-
-
- if (isset($vals['brand_id'])){
-
- $this->brand_id = $vals['brand_id'];
- }
-
-
- if (isset($vals['date'])){
-
- $this->date = $vals['date'];
- }
-
-
- if (isset($vals['order_type'])){
-
- $this->order_type = $vals['order_type'];
- }
-
-
- }
-
- }
-
-
- public function getName(){
-
- return 'SalesOrderDetail';
- }
-
- public function read($input){
-
- $input->readStructBegin();
- while(true){
-
- $schemeField = $input->readFieldBegin();
- if ($schemeField == null) break;
- $needSkip = true;
-
-
- if ("order_id" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->order_id);
-
- }
-
-
-
-
- if ("barcode" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->barcode);
-
- }
-
-
-
-
- if ("amount" == $schemeField){
-
- $needSkip = false;
- $input->readI32($this->amount);
-
- }
-
-
-
-
- if ("price" == $schemeField){
-
- $needSkip = false;
- $input->readDouble($this->price);
-
- }
-
-
-
-
- if ("brand_name" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->brand_name);
-
- }
-
-
-
-
- if ("product_name" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->product_name);
-
- }
-
-
-
-
- if ("brand_id" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->brand_id);
-
- }
-
-
-
-
- if ("date" == $schemeField){
-
- $needSkip = false;
- $input->readString($this->date);
-
- }
-
-
-
-
- if ("order_type" == $schemeField){
-
- $needSkip = false;
- $input->readI32($this->order_type);
-
- }
-
-
-
- if($needSkip){
-
- \Osp\Protocol\ProtocolUtil::skip($input);
- }
-
- $input->readFieldEnd();
- }
-
- $input->readStructEnd();
-
-
-
- }
-
- public function write($output){
-
- $xfer = 0;
- $xfer += $output->writeStructBegin();
-
- if($this->order_id !== null) {
-
- $xfer += $output->writeFieldBegin('order_id');
- $xfer += $output->writeString($this->order_id);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->barcode !== null) {
-
- $xfer += $output->writeFieldBegin('barcode');
- $xfer += $output->writeString($this->barcode);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->amount !== null) {
-
- $xfer += $output->writeFieldBegin('amount');
- $xfer += $output->writeI32($this->amount);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->price !== null) {
-
- $xfer += $output->writeFieldBegin('price');
- $xfer += $output->writeDouble($this->price);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->brand_name !== null) {
-
- $xfer += $output->writeFieldBegin('brand_name');
- $xfer += $output->writeString($this->brand_name);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->product_name !== null) {
-
- $xfer += $output->writeFieldBegin('product_name');
- $xfer += $output->writeString($this->product_name);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->brand_id !== null) {
-
- $xfer += $output->writeFieldBegin('brand_id');
- $xfer += $output->writeString($this->brand_id);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->date !== null) {
-
- $xfer += $output->writeFieldBegin('date');
- $xfer += $output->writeString($this->date);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- if($this->order_type !== null) {
-
- $xfer += $output->writeFieldBegin('order_type');
- $xfer += $output->writeI32($this->order_type);
-
- $xfer += $output->writeFieldEnd();
- }
-
-
- $xfer += $output->writeFieldStop();
- $xfer += $output->writeStructEnd();
- return $xfer;
- }
-
- }
- ?>
|