TriKaspar/php_riak — pull request #57 by FabioBatSilva (2013-12-06 22:49:01+00:00)
Title: Conflict resolution strategy

This patch implements conflict resolvers by adding the method ``Riak\\Output\\Output#getObject``

If the `Riak\\Output\\Output` contain more than one object/siblings
it will try to resolve its siblings using a `Riak\Output\ConflictResolver` specified by key or bucket.

The ConflictResolver will be responsible for resolving the siblings into a single object.
if there are no resolver configured it will throws a `Riak\Exception\NonUniqueException`

conflict resolver impl:
```php
first();
$value = 0;

foreach ($objects as $object) {
$value += intval($object->getContent());
}

$winner->setContent($value);

return $winner;
}
}
```

Bucket resolution :
```php
setConflictResolver(new MyResolver());

$output = $bucket->get($key);

echo $output->hasSiblings(); // true

$object = $output->getObject();
```

By key resolution :
```php
get($key, $options);

echo $output->hasSiblings(); // true

$object = $output->getObject();
```