Beispiel #1
0
 /**
  * @ignore
  */
 private function serializeMapFieldToStream($field, $output)
 {
     $getter = $field->getGetter();
     $values = $this->{$getter}();
     $count = count($values);
     if ($count === 0) {
         return true;
     }
     foreach ($values as $key => $value) {
         $map_entry = new MapEntry($field->getMessageType());
         $map_entry->setKey($key);
         $map_entry->setValue($value);
         if (!GPBWire::serializeFieldToStream($map_entry, $field, true, $output)) {
             return false;
         }
     }
     return true;
 }