public function __construct($indexName, $key, $rid = null, TokenFormatter $ridFormatter = null)
{
parent::__construct();
$ridFormatter = $ridFormatter ?: new EmbeddedRidFormatter();
$this->setToken('Name', $indexName);
if (!is_null($key)) {
$this->where("key = ?", $key);
}
if ($rid) {
$rid = $ridFormatter::format(array($rid));
$method = $key ? 'andWhere' : 'where';
$this->{$method}("rid = {$rid}");
}
}