Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->status_code !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->status_code);
     }
     if ($this->request_id !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->request_id);
     }
     if ($this->requests !== null) {
         foreach ($this->requests as $val) {
             $writer->writeVarint($stream, 34);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->platform_requests !== null) {
         foreach ($this->platform_requests as $val) {
             $writer->writeVarint($stream, 50);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->latitude !== null) {
         $writer->writeVarint($stream, 57);
         $writer->writeDouble($stream, $this->latitude);
     }
     if ($this->longitude !== null) {
         $writer->writeVarint($stream, 65);
         $writer->writeDouble($stream, $this->longitude);
     }
     if ($this->accuracy !== null) {
         $writer->writeVarint($stream, 73);
         $writer->writeDouble($stream, $this->accuracy);
     }
     if ($this->auth_info !== null) {
         $writer->writeVarint($stream, 82);
         $writer->writeVarint($stream, $this->auth_info->serializedSize($sizeContext));
         $this->auth_info->writeTo($context);
     }
     if ($this->auth_ticket !== null) {
         $writer->writeVarint($stream, 90);
         $writer->writeVarint($stream, $this->auth_ticket->serializedSize($sizeContext));
         $this->auth_ticket->writeTo($context);
     }
     if ($this->ms_since_last_locationfix !== null) {
         $writer->writeVarint($stream, 96);
         $writer->writeVarint($stream, $this->ms_since_last_locationfix);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->status_code !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->status_code->value());
     }
     if ($this->request_id !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeVarint($stream, $this->request_id);
     }
     if ($this->api_url !== null) {
         $writer->writeVarint($stream, 26);
         $writer->writeString($stream, $this->api_url);
     }
     if ($this->platform_returns !== null) {
         foreach ($this->platform_returns as $val) {
             $writer->writeVarint($stream, 50);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->auth_ticket !== null) {
         $writer->writeVarint($stream, 58);
         $writer->writeVarint($stream, $this->auth_ticket->serializedSize($sizeContext));
         $this->auth_ticket->writeTo($context);
     }
     if ($this->returns !== null) {
         foreach ($this->returns as $val) {
             $writer->writeVarint($stream, 802);
             $writer->writeByteStream($stream, $val);
         }
     }
     if ($this->error !== null) {
         $writer->writeVarint($stream, 810);
         $writer->writeString($stream, $this->error);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }