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

mkdirWithInOrderKey() public method

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