Protobuf\AbstractMessage::__construct PHP 메소드

__construct() 공개 메소드

Message constructor
public __construct ( Stream | resource | string $stream = null, Configuration $configuration = null )
$stream Stream | resource | string
$configuration Configuration
    public function __construct($stream = null, \Protobuf\Configuration $configuration = null)
    {
        if ($stream === null) {
            return;
        }
        $config = $configuration ?: \Protobuf\Configuration::getInstance();
        $context = $config->createReadContext($stream);
        $this->readFrom($context);
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function __construct($stream = null, \Protobuf\Configuration $configuration = null)
 {
     $this->ctype = \google\protobuf\FieldOptions\CType::STRING();
     $this->jstype = \google\protobuf\FieldOptions\JSType::JS_NORMAL();
     $this->lazy = false;
     $this->deprecated = false;
     $this->weak = false;
     parent::__construct($stream, $configuration);
 }
All Usage Examples Of Protobuf\AbstractMessage::__construct