/** * Get a binary representation of the query, ready to send to orient. * * @return string A binary serialized version of the query class. */ public function binarySerialize() { $bytes = Binary::packString($this->getOrientClass()); $bytes .= Binary::packString($this->language); $bytes .= Binary::packString($this->text); if (count($this->params)) { $bytes .= Binary::packString($this->serializeParams()); } else { $bytes .= Binary::packInt(0); } $bytes .= Binary::packByte(0); return $bytes; }
/** * Write a boolean to the socket. * * @param bool $value */ protected function writeBoolean($value) { $this->socket->write(Binary::packByte((bool) $value)); }