/** * Update the map in Riak by adding/updating the map mapped to the provided key. * * @param string $key * @param \Riak\Client\Command\DataType\MapUpdate|array $value * * @return \Riak\Client\Command\DataType\StoreMap */ public function updateMap($key, $value) { $update = !$value instanceof MapUpdate ? MapUpdate::createFromArray($value) : $value; $this->update->updateMap($key, $update->getOp()); return $this; }
/** * @expectedException InvalidArgumentException * @expectedExceptionMessage Map element "invalid_key" must be of the type (boolean, string, integer, or an array), "stdClass" given. */ public function testCreateWithInvalidArgumentException() { MapUpdate::createFromArray(['invalid_key' => new \stdClass()]); }