/** * @param \Riak\Client\ProtoBuf\MapEntry[] $entry * * @return mixed */ public function convertMapEntry(ProtoBuf\MapEntry $entry) { $field = $entry->getField(); $type = $field->getType(); if ($type === MapFieldType::MAP) { return $this->fromProtoBuf($entry->map_value); } if ($type === MapFieldType::SET) { return $entry->set_value; } if ($type === MapFieldType::FLAG) { return $entry->flag_value == ProtoBuf\MapUpdate\FlagOp::ENABLE; } if ($type === MapFieldType::COUNTER) { return $entry->counter_value; } if ($type === MapFieldType::REGISTER) { return $entry->register_value; } throw new InvalidArgumentException(sprintf('Unknown crdt field type : %s', $type)); }