• Модуль: pull
  • Путь к файлу: ~/bitrix/modules/pull/lib/protobuf/sender.php
  • Класс: BitrixPullProtobufSender
  • Вызов: Sender::writeTo
public function writeTo(ProtobufWriteContext $context)
    {
        $stream      = $context->getStream();
        $writer      = $context->getWriter();
        $sizeContext = $context->getComputeSizeContext();

        if ($this->type !== null) {
            $writer->writeVarint($stream, 8);
            $writer->writeVarint($stream, $this->type->value());
        }

        if ($this->id !== null) {
            $writer->writeVarint($stream, 18);
            $writer->writeByteStream($stream, $this->id);
        }

        if ($this->extensions !== null) {
            $this->extensions->writeTo($context);
        }

        return $stream;
    }