LinkORB\Component\Etcd\Client::setWithInOrderKey PHP Method

setWithInOrderKey() public method

create a new key in a directory with auto generated id
public setWithInOrderKey ( string $dir, string $value, integer $ttl, array $condition = [] ) : array
$dir string
$value string
$ttl integer
$condition array
return array $body
    public function setWithInOrderKey($dir, $value, $ttl = 0, $condition = array())
    {
        $data = array('value' => $value);
        if ($ttl) {
            $data['ttl'] = $ttl;
        }
        $request = $this->guzzleclient->post($this->buildKeyUri($dir), null, $data, array('query' => $condition));
        $response = $request->send();
        $body = $response->json();
        return $body;
    }